Make merge_lora switches with multiple loras behave like it used to and how the tooltip indicates

This commit is contained in:
kijai
2025-09-06 19:28:16 +03:00
parent bafd5503ac
commit ae768f53a4
2 changed files with 10 additions and 8 deletions
+7 -3
View File
@@ -173,7 +173,8 @@ def apply_lora(model, device_to, transformer_load_device, params_to_keep=None, d
to_load.append((n, m, params))
to_load.sort(reverse=True)
#pbar = ProgressBar(len(to_load))
cnt = 0
pbar = ProgressBar(len(to_load))
for x in tqdm(to_load, desc="Loading model and applying LoRA weights:", leave=True):
name = x[0]
m = x[1]
@@ -207,8 +208,11 @@ def apply_lora(model, device_to, transformer_load_device, params_to_keep=None, d
except:
continue
m.comfy_patched_weights = True
#pbar.update(1)
cnt += 1
if cnt % 100 == 0:
pbar.update(100)
# After LoRA patching, scale weights that have scale_weight but are NOT LoRA patched
if len(scale_weights) > 0 and not getattr(model, "scale_weights_applied", False):
for name, param in model.model.diffusion_model.named_parameters():