mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-06 23:37:10 +08:00
patch the right keys
This commit is contained in:
parent
67bd8d67c2
commit
e716b529f7
@ -119,10 +119,15 @@ class ReduxApplyWithAttnMask:
|
|||||||
for i, block in enumerate(m.model.diffusion_model.double_blocks):
|
for i, block in enumerate(m.model.diffusion_model.double_blocks):
|
||||||
# is there already a patch there?
|
# is there already a patch there?
|
||||||
# if so, the attnwrapper can chain off it
|
# if so, the attnwrapper can chain off it
|
||||||
previous = previous_patches.get(("double_blocks", i), block)
|
previous = previous_patches.get(("double_block", i), block)
|
||||||
wrapper = _ReduxAttnWrapper(previous, token_counts, bias=attn_bias, is_first=i==0)
|
wrapper = _ReduxAttnWrapper(previous, token_counts, bias=attn_bias, is_first=i==0)
|
||||||
# I think this properly clones things?
|
# I think this properly clones things?
|
||||||
m.set_model_patch_replace(wrapper, "dit", "double_blocks", i)
|
m.set_model_patch_replace(wrapper, "dit", "double_block", i)
|
||||||
|
|
||||||
|
for i, block in enumerate(m.model.diffusion_model.single_blocks):
|
||||||
|
previous = previous_patches.get(("single_block", i), block)
|
||||||
|
wrapper = _ReduxAttnWrapper(previous, token_counts, bias=attn_bias)
|
||||||
|
m.set_model_patch_replace(wrapper, "dit", "single_block", i)
|
||||||
else:
|
else:
|
||||||
m = model
|
m = model
|
||||||
return (m, c)
|
return (m, c)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user