lora support

This commit is contained in:
AUTOMATIC1111 2023-07-13 12:59:31 +03:00
parent 594c8e7b26
commit 76ebb175ca
1 changed files with 5 additions and 0 deletions

View File

@ -179,6 +179,11 @@ def load_lora(name, lora_on_disk):
if m:
sd_module = shared.sd_model.lora_layer_mapping.get(m.group(1), None)
# SDXL loras seem to already have correct compvis keys, so only need to replace "lora_unet" with "diffusion_model"
if sd_module is None and "lora_unet" in key_diffusers_without_lora_parts:
key = key_diffusers_without_lora_parts.replace("lora_unet", "diffusion_model")
sd_module = shared.sd_model.lora_layer_mapping.get(key, None)
if sd_module is None:
keys_failed_to_match[key_diffusers] = key
continue