mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-20 03:13:30 +00:00
Now the model merge blocks node will use the longest match.
This commit is contained in:
parent
3a09fac835
commit
c02f3baeaf
@ -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, )
|
||||||
|
Loading…
Reference in New Issue
Block a user