diff --git a/modules/processing.py b/modules/processing.py index ba685349..343eb43a 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -1326,7 +1326,6 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): self.rng = rng.ImageRNG(samples.shape[1:], self.seeds, subseeds=self.subseeds, subseed_strength=self.subseed_strength, seed_resize_from_h=self.seed_resize_from_h, seed_resize_from_w=self.seed_resize_from_w) noise = self.rng.next() - samples = samples.to(noise) # GC now before running the next img2img to prevent running out of memory devices.torch_gc() diff --git a/modules/sd_samplers_kdiffusion.py b/modules/sd_samplers_kdiffusion.py index 1db4903f..3cb61eb3 100644 --- a/modules/sd_samplers_kdiffusion.py +++ b/modules/sd_samplers_kdiffusion.py @@ -155,7 +155,8 @@ class KDiffusionSampler(sd_samplers_common.Sampler): sigmas = self.get_sigmas(p, steps) sigma_sched = sigmas[steps - t_enc - 1:] - xi = x.to(noise) + noise * sigma_sched[0] + x = x.to(noise) + xi = x + noise * sigma_sched[0] if opts.img2img_extra_noise > 0: p.extra_generation_params["Extra noise"] = opts.img2img_extra_noise