diff --git a/modules/sd_samplers_cfg_denoiser.py b/modules/sd_samplers_cfg_denoiser.py index 60aed8e0..ac196175 100644 --- a/modules/sd_samplers_cfg_denoiser.py +++ b/modules/sd_samplers_cfg_denoiser.py @@ -173,7 +173,7 @@ class CFGDenoiser(torch.nn.Module): uncond = pad_cond(uncond, num_repeats, empty) self.padded_cond_uncond = True - unet_dtype = self.inner_model.inner_model.unet_patcher.model.model_config.unet_config['dtype'] + unet_dtype = self.inner_model.inner_model.forge_objects.unet.model.model_config.unet_config['dtype'] x_input_dtype = x_in.dtype x_in = x_in.to(unet_dtype) diff --git a/modules/sd_samplers_common.py b/modules/sd_samplers_common.py index 63fb1ba3..91c35b7d 100644 --- a/modules/sd_samplers_common.py +++ b/modules/sd_samplers_common.py @@ -187,7 +187,7 @@ def apply_refiner(cfg_denoiser, x): cfg_denoiser.update_inner_model() inference_memory = 0 - unet_patcher = refiner.unet_patcher + unet_patcher = refiner.forge_objects.unet model_management.load_models_gpu( [unet_patcher], unet_patcher.memory_required([x.shape[0]] + list(x.shape[1:])) + inference_memory) diff --git a/modules/sd_samplers_kdiffusion.py b/modules/sd_samplers_kdiffusion.py index 3cb61eb3..cd34bb5a 100644 --- a/modules/sd_samplers_kdiffusion.py +++ b/modules/sd_samplers_kdiffusion.py @@ -142,7 +142,7 @@ class KDiffusionSampler(sd_samplers_common.Sampler): def sample_img2img(self, p, x, noise, conditioning, unconditional_conditioning, steps=None, image_conditioning=None): inference_memory = 0 - unet_patcher = self.model_wrap.inner_model.unet_patcher + unet_patcher = self.model_wrap.inner_model.forge_objects.unet ldm_patched.modules.model_management.load_models_gpu( [unet_patcher], unet_patcher.memory_required([x.shape[0] * 2] + list(x.shape[1:])) + inference_memory) @@ -206,7 +206,7 @@ class KDiffusionSampler(sd_samplers_common.Sampler): def sample(self, p, x, conditioning, unconditional_conditioning, steps=None, image_conditioning=None): inference_memory = 0 - unet_patcher = self.model_wrap.inner_model.unet_patcher + unet_patcher = self.model_wrap.inner_model.forge_objects.unet ldm_patched.modules.model_management.load_models_gpu( [unet_patcher], unet_patcher.memory_required([x.shape[0] * 2] + list(x.shape[1:])) + inference_memory) diff --git a/modules/sd_samplers_timesteps.py b/modules/sd_samplers_timesteps.py index fc0505ef..467860a4 100644 --- a/modules/sd_samplers_timesteps.py +++ b/modules/sd_samplers_timesteps.py @@ -99,7 +99,7 @@ class CompVisSampler(sd_samplers_common.Sampler): def sample_img2img(self, p, x, noise, conditioning, unconditional_conditioning, steps=None, image_conditioning=None): inference_memory = 0 - unet_patcher = self.model_wrap.inner_model.unet_patcher + unet_patcher = self.model_wrap.inner_model.forge_objects.unet ldm_patched.modules.model_management.load_models_gpu( [unet_patcher], unet_patcher.memory_required([x.shape[0] * 2] + list(x.shape[1:])) + inference_memory) @@ -151,7 +151,7 @@ class CompVisSampler(sd_samplers_common.Sampler): def sample(self, p, x, conditioning, unconditional_conditioning, steps=None, image_conditioning=None): inference_memory = 0 - unet_patcher = self.model_wrap.inner_model.unet_patcher + unet_patcher = self.model_wrap.inner_model.forge_objects.unet ldm_patched.modules.model_management.load_models_gpu( [unet_patcher], unet_patcher.memory_required([x.shape[0] * 2] + list(x.shape[1:])) + inference_memory)