Fix control lora when not last lora to be loaded
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user