Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
243d9a49
Unverified
Commit
243d9a49
authored
Dec 04, 2024
by
YiYi Xu
Committed by
GitHub
Dec 04, 2024
Browse files
pass attn mask arg for flux (#10122)
parent
96220390
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/diffusers/models/attention_processor.py
src/diffusers/models/attention_processor.py
+3
-1
No files found.
src/diffusers/models/attention_processor.py
View file @
243d9a49
...
@@ -1908,7 +1908,9 @@ class FluxAttnProcessor2_0:
...
@@ -1908,7 +1908,9 @@ class FluxAttnProcessor2_0:
query
=
apply_rotary_emb
(
query
,
image_rotary_emb
)
query
=
apply_rotary_emb
(
query
,
image_rotary_emb
)
key
=
apply_rotary_emb
(
key
,
image_rotary_emb
)
key
=
apply_rotary_emb
(
key
,
image_rotary_emb
)
hidden_states
=
F
.
scaled_dot_product_attention
(
query
,
key
,
value
,
dropout_p
=
0.0
,
is_causal
=
False
)
hidden_states
=
F
.
scaled_dot_product_attention
(
query
,
key
,
value
,
attn_mask
=
attention_mask
,
dropout_p
=
0.0
,
is_causal
=
False
)
hidden_states
=
hidden_states
.
transpose
(
1
,
2
).
reshape
(
batch_size
,
-
1
,
attn
.
heads
*
head_dim
)
hidden_states
=
hidden_states
.
transpose
(
1
,
2
).
reshape
(
batch_size
,
-
1
,
attn
.
heads
*
head_dim
)
hidden_states
=
hidden_states
.
to
(
query
.
dtype
)
hidden_states
=
hidden_states
.
to
(
query
.
dtype
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment