remove legacy config

This commit is contained in:
layerdiffusion
2024-08-03 17:04:56 -07:00
parent fb3052350b
commit be3f0a0039
3 changed files with 3 additions and 3 deletions

View File

@@ -350,7 +350,7 @@ class ControlLora(ControlNet):
def pre_run(self, model, percent_to_timestep_function):
super().pre_run(model, percent_to_timestep_function)
controlnet_config = model.diffusion_model.legacy_config.copy()
controlnet_config = model.diffusion_model.config.copy()
controlnet_config.pop("out_channels")
controlnet_config["hint_channels"] = self.control_weights["input_hint_block.0.weight"].shape[1]
controlnet_config["dtype"] = dtype = model.storage_dtype

View File

@@ -246,7 +246,7 @@ def model_lora_keys_unet(model, key_map={}):
key_map["lora_unet_{}".format(key_lora)] = k
key_map["lora_prior_unet_{}".format(key_lora)] = k
diffusers_keys = unet_to_diffusers(model.diffusion_model.legacy_config)
diffusers_keys = unet_to_diffusers(model.diffusion_model.config)
for k in diffusers_keys:
if k.endswith(".weight"):
unet_key = "diffusion_model.{}".format(diffusers_keys[k])

View File

@@ -52,7 +52,7 @@ class FreeU:
class FreeU_V2:
def patch(self, model, b1, b2, s1, s2):
model_channels = model.model.diffusion_model.legacy_config["model_channels"]
model_channels = model.model.diffusion_model.config["model_channels"]
scale_dict = {model_channels * 4: (b1, s1), model_channels * 2: (b2, s2)}
on_cpu_devices = {}