Fix control lora when not last lora to be loaded

This commit is contained in:
kijai
2025-08-29 14:45:03 +03:00
parent 999a314652
commit 704cca215b
+2 -1
View File
@@ -878,6 +878,7 @@ def patch_stand_in_lora(transformer, lora_sd, transformer_load_device, base_dtyp
def add_lora_weights(patcher, lora, base_dtype, merge_loras=False):
unianimate_sd = None
control_lora=False
#spacepxl's control LoRA patch
for l in lora:
log.info(f"Loading LoRA: {l['name']} with strength: {l['strength']}")
@@ -904,7 +905,7 @@ def add_lora_weights(patcher, lora, base_dtype, merge_loras=False):
# Filter out any LoRA keys containing 'img' if the base model state_dict has no 'img' keys
#if not any('img' in k for k in sd.keys()):
# lora_sd = {k: v for k, v in lora_sd.items() if 'img' not in k}
control_lora=False
if "diffusion_model.patch_embedding.lora_A.weight" in lora_sd:
control_lora = True
#stand-in LoRA patch