"git@developer.sourcefind.cn:chenpangpang/ComfyUI.git" did not exist on "fed0a4dd29852e4808382ef9428a2256214667bf"
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: ...@@ -46,9 +46,11 @@ class ModelMergeBlocks:
ratio = default_ratio ratio = default_ratio
k_unet = k[len("diffusion_model."):] k_unet = k[len("diffusion_model."):]
last_arg_size = 0
for arg in kwargs: for arg in kwargs:
if k_unet.startswith(arg): if k_unet.startswith(arg) and last_arg_size < len(arg):
ratio = kwargs[arg] ratio = kwargs[arg]
last_arg_size = len(arg)
m.add_patches({k: (sd[k], )}, 1.0 - ratio, ratio) m.add_patches({k: (sd[k], )}, 1.0 - ratio, ratio)
return (m, ) 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