fix broken DDIM with img2img
This commit is contained in:
parent
a703f56d73
commit
d62954c2bc
|
@ -136,6 +136,8 @@ class VanillaStableDiffusionSampler:
|
|||
def sample_img2img(self, p, x, noise, conditioning, unconditional_conditioning, steps=None):
|
||||
steps, t_enc = setup_img2img_steps(p, steps)
|
||||
|
||||
self.initialize(p)
|
||||
|
||||
# existing code fails with cetain step counts, like 9
|
||||
try:
|
||||
self.sampler.make_schedule(ddim_num_steps=steps, ddim_eta=self.eta, ddim_discretize=p.ddim_discretize, verbose=False)
|
||||
|
@ -144,8 +146,6 @@ class VanillaStableDiffusionSampler:
|
|||
|
||||
x1 = self.sampler.stochastic_encode(x, torch.tensor([t_enc] * int(x.shape[0])).to(shared.device), noise=noise)
|
||||
|
||||
self.initialize(p)
|
||||
|
||||
self.init_latent = x
|
||||
self.step = 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user