This commit is contained in:
lllyasviel
2024-01-25 12:21:44 -08:00
parent 1e7becbeb6
commit 4a597743f0
4 changed files with 6 additions and 6 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)