Spaces:
Paused
Paused
dump unmatched lora
Browse files- modules/core.py +4 -1
modules/core.py
CHANGED
@@ -93,13 +93,16 @@ class StableDiffusionModel:
|
|
93 |
|
94 |
for lora_filename, weight in loras_to_load:
|
95 |
lora_unmatch = ldm_patched.modules.utils.load_torch_file(lora_filename, safe_load=False)
|
|
|
|
|
|
|
96 |
lora_unet, lora_unmatch = match_lora(lora_unmatch, self.lora_key_map_unet)
|
97 |
lora_clip, lora_unmatch = match_lora(lora_unmatch, self.lora_key_map_clip)
|
98 |
|
99 |
if len(lora_unmatch) > 12:
|
100 |
# model mismatch
|
101 |
print(f'NOT Loaded LoRA [{lora_filename}] for model [{self.filename}] '
|
102 |
-
f'with {len(lora_unmatch)} unmatched keys {list(lora_unmatch.keys())} \
|
103 |
continue
|
104 |
|
105 |
if len(lora_unmatch) > 0:
|
|
|
93 |
|
94 |
for lora_filename, weight in loras_to_load:
|
95 |
lora_unmatch = ldm_patched.modules.utils.load_torch_file(lora_filename, safe_load=False)
|
96 |
+
print(f'Loading LoRA [{lora_filename}] for model [{self.filename}] '
|
97 |
+
f'with {len(lora_unmatch)} initailly unmatched keys {list(lora_unmatch.keys())}')
|
98 |
+
|
99 |
lora_unet, lora_unmatch = match_lora(lora_unmatch, self.lora_key_map_unet)
|
100 |
lora_clip, lora_unmatch = match_lora(lora_unmatch, self.lora_key_map_clip)
|
101 |
|
102 |
if len(lora_unmatch) > 12:
|
103 |
# model mismatch
|
104 |
print(f'NOT Loaded LoRA [{lora_filename}] for model [{self.filename}] '
|
105 |
+
f'with {len(lora_unmatch)} unmatched keys {list(lora_unmatch.keys())} \nmatched keys {list(lora_unet.keys())}')
|
106 |
continue
|
107 |
|
108 |
if len(lora_unmatch) > 0:
|