Commit c02f3bae authored by comfyanonymous's avatar comfyanonymous
Browse files

Now the model merge blocks node will use the longest match.

parent 3a09fac8
......@@ -46,9 +46,11 @@ class ModelMergeBlocks:
ratio = default_ratio
k_unet = k[len("diffusion_model."):]
last_arg_size = 0
for arg in kwargs:
if k_unet.startswith(arg):
if k_unet.startswith(arg) and last_arg_size < len(arg):
ratio = kwargs[arg]
last_arg_size = len(arg)
m.add_patches({k: (sd[k], )}, 1.0 - ratio, ratio)
return (m, )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment