mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-04 18:27:07 +08:00
Let optimized_attention handle output reshape for ACE
This commit is contained in:
parent
5284548432
commit
feb3d75102
@ -433,11 +433,8 @@ class CustomerAttnProcessor2_0:
|
|||||||
|
|
||||||
# the output of sdp = (batch, num_heads, seq_len, head_dim)
|
# the output of sdp = (batch, num_heads, seq_len, head_dim)
|
||||||
hidden_states = optimized_attention(
|
hidden_states = optimized_attention(
|
||||||
query, key, value, heads=query.shape[1], mask=attention_mask, skip_reshape=True, skip_output_reshape=True,
|
query, key, value, heads=query.shape[1], mask=attention_mask, skip_reshape=True,
|
||||||
)
|
).to(query.dtype)
|
||||||
|
|
||||||
hidden_states = hidden_states.transpose(1, 2).reshape(batch_size, -1, attn.heads * head_dim)
|
|
||||||
hidden_states = hidden_states.to(query.dtype)
|
|
||||||
|
|
||||||
# linear proj
|
# linear proj
|
||||||
hidden_states = attn.to_out[0](hidden_states)
|
hidden_states = attn.to_out[0](hidden_states)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user