Fix a bug where DDIM wouldn't get the correct steps from the UI after the first run

This commit is contained in:
cmdr2 2022-09-23 21:22:44 +05:30
parent 119d5ba7ff
commit 9bb091d31e

View File

@ -523,6 +523,9 @@ def _txt2img(opt_W, opt_H, opt_n_samples, opt_ddim_steps, opt_scale, start_code,
while torch.cuda.memory_allocated() / 1e6 >= mem:
time.sleep(1)
if sampler_name == 'ddim':
model.make_schedule(ddim_num_steps=opt_ddim_steps, ddim_eta=opt_ddim_eta, verbose=False)
samples_ddim = model.sample(
S=opt_ddim_steps,
conditioning=c,