From e503c6092e482f966d3e0ecb269412e67cd56900 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Sat, 26 Nov 2022 00:55:39 +0530 Subject: [PATCH] Ddim decode for img2img --- ui/sd_internal/runtime.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/ui/sd_internal/runtime.py b/ui/sd_internal/runtime.py index e8ee75d3..2a989e46 100644 --- a/ui/sd_internal/runtime.py +++ b/ui/sd_internal/runtime.py @@ -819,19 +819,8 @@ def _img2img(init_latent, t_enc, batch_size, opt_scale, c, uc, opt_ddim_steps, o z_enc = sampler.stochastic_encode(init_latent, torch.tensor([t_enc] * batch_size).to(thread_data.device)) - #samples = sampler.decode(z_enc, c, t_enc, unconditional_guidance_scale=opt.scale,unconditional_conditioning=uc, ) - samples_ddim = sampler.sample( - t_enc, - batch_size, - shape = [opt_C, opt_H // opt_f, opt_W // opt_f], - conditioning=c, - x0=z_enc, - unconditional_guidance_scale=opt_scale, - unconditional_conditioning=uc, - img_callback=img_callback, - mask=mask, - x_T=x_T - ) + samples_ddim = sampler.decode(z_enc, c, t_enc, unconditional_guidance_scale=opt_scale,unconditional_conditioning=uc, img_callback=img_callback) + else: z_enc = thread_data.model.stochastic_encode( init_latent,