diff --git a/backend/nn/unet.py b/backend/nn/unet.py index 30122752..41c1037e 100644 --- a/backend/nn/unet.py +++ b/backend/nn/unet.py @@ -660,6 +660,7 @@ class IntegratedUNet2DConditionModel(nn.Module, ConfigMixin): transformer_depth=transformer_depth, transformer_depth_output=transformer_depth_output, transformer_depth_middle=transformer_depth_middle, + model_channels=model_channels, ) if context_dim is not None: diff --git a/ldm_patched/contrib/external_freelunch.py b/ldm_patched/contrib/external_freelunch.py index 59ec5bab..8d81b8db 100644 --- a/ldm_patched/contrib/external_freelunch.py +++ b/ldm_patched/contrib/external_freelunch.py @@ -78,7 +78,7 @@ class FreeU_V2: CATEGORY = "model_patches" def patch(self, model, b1, b2, s1, s2): - model_channels = model.model.model_config.unet_config["model_channels"] + model_channels = model.model.diffusion_model.legacy_config["model_channels"] scale_dict = {model_channels * 4: (b1, s1), model_channels * 2: (b2, s2)} on_cpu_devices = {}