mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-10 21:17:18 +08:00
Fix attn_mask issue in DoubleStreamBlock.forward(); updated model.py for compatibility
This commit is contained in:
parent
f40076096e
commit
decce572f3
@ -143,7 +143,7 @@ class DoubleStreamBlock(nn.Module):
|
|||||||
)
|
)
|
||||||
self.flipped_img_txt = flipped_img_txt
|
self.flipped_img_txt = flipped_img_txt
|
||||||
|
|
||||||
def forward(self, img: Tensor, txt: Tensor, vec: Tensor, pe: Tensor, attn_mask=None):
|
def forward(self, img: Tensor, txt: Tensor, vec: Tensor, pe: Tensor, attn_mask=None, **kwargs):
|
||||||
img_mod1, img_mod2 = self.img_mod(vec)
|
img_mod1, img_mod2 = self.img_mod(vec)
|
||||||
txt_mod1, txt_mod2 = self.txt_mod(vec)
|
txt_mod1, txt_mod2 = self.txt_mod(vec)
|
||||||
|
|
||||||
|
|||||||
@ -139,11 +139,10 @@ class Flux(nn.Module):
|
|||||||
txt = out["txt"]
|
txt = out["txt"]
|
||||||
img = out["img"]
|
img = out["img"]
|
||||||
else:
|
else:
|
||||||
img, txt = block(img=img,
|
if attn_mask is not None:
|
||||||
txt=txt,
|
img, txt = block(img=img, txt=txt, vec=vec, pe=pe, attn_mask=attn_mask)
|
||||||
vec=vec,
|
else:
|
||||||
pe=pe,
|
img, txt = block(img=img, txt=txt, vec=vec, pe=pe)
|
||||||
attn_mask=attn_mask)
|
|
||||||
|
|
||||||
if control is not None: # Controlnet
|
if control is not None: # Controlnet
|
||||||
control_i = control.get("input")
|
control_i = control.get("input")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user