From 1c19f8f303b36db728092a62cb4746a063dc9650 Mon Sep 17 00:00:00 2001 From: lllyasviel Date: Thu, 25 Jan 2024 08:06:15 -0800 Subject: [PATCH] i --- modules/sd_samplers_kdiffusion.py | 3 +++ modules/sd_samplers_timesteps.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/modules/sd_samplers_kdiffusion.py b/modules/sd_samplers_kdiffusion.py index e3906d1a..1c1f7f16 100644 --- a/modules/sd_samplers_kdiffusion.py +++ b/modules/sd_samplers_kdiffusion.py @@ -147,6 +147,9 @@ class KDiffusionSampler(sd_samplers_common.Sampler): [unet_patcher], unet_patcher.memory_required([x.shape[0] * 2] + list(x.shape[1:])) + inference_memory) + self.model_wrap.log_sigmas = self.model_wrap.log_sigmas.to(unet_patcher.current_device) + self.model_wrap.sigmas = self.model_wrap.sigmas.to(unet_patcher.current_device) + steps, t_enc = sd_samplers_common.setup_img2img_steps(p, steps) sigmas = self.get_sigmas(p, steps) diff --git a/modules/sd_samplers_timesteps.py b/modules/sd_samplers_timesteps.py index e008e6cb..a99a6a18 100644 --- a/modules/sd_samplers_timesteps.py +++ b/modules/sd_samplers_timesteps.py @@ -104,6 +104,8 @@ class CompVisSampler(sd_samplers_common.Sampler): [unet_patcher], unet_patcher.memory_required([x.shape[0] * 2] + list(x.shape[1:])) + inference_memory) + self.model_wrap.inner_model.alphas_cumprod = self.model_wrap.inner_model.alphas_cumprod.to(unet_patcher.current_device) + steps, t_enc = sd_samplers_common.setup_img2img_steps(p, steps) timesteps = self.get_timesteps(p, steps)