Fix the 'Expected all tensors to be on the same device' error

This commit is contained in:
cmdr2
2022-09-23 11:44:50 +05:30
parent 83cb473a45
commit a3de0820b3
2 changed files with 30 additions and 24 deletions

View File

@ -522,9 +522,6 @@ 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' and not hasattr(model, 'ddim_timesteps'):
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,