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
4a4afd5e
Unverified
Commit
4a4afd5e
authored
Jan 14, 2025
by
hlky
Committed by
GitHub
Jan 14, 2025
Browse files
Fix batch > 1 in HunyuanVideo (#10548)
parent
aa79d7da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/diffusers/models/transformers/transformer_hunyuan_video.py
...iffusers/models/transformers/transformer_hunyuan_video.py
+2
-1
No files found.
src/diffusers/models/transformers/transformer_hunyuan_video.py
View file @
4a4afd5e
...
@@ -727,7 +727,8 @@ class HunyuanVideoTransformer3DModel(ModelMixin, ConfigMixin, PeftAdapterMixin,
...
@@ -727,7 +727,8 @@ class HunyuanVideoTransformer3DModel(ModelMixin, ConfigMixin, PeftAdapterMixin,
for
i
in
range
(
batch_size
):
for
i
in
range
(
batch_size
):
attention_mask
[
i
,
:
effective_sequence_length
[
i
]]
=
True
attention_mask
[
i
,
:
effective_sequence_length
[
i
]]
=
True
attention_mask
=
attention_mask
.
unsqueeze
(
1
)
# [B, 1, N], for broadcasting across attention heads
# [B, 1, 1, N], for broadcasting across attention heads
attention_mask
=
attention_mask
.
unsqueeze
(
1
).
unsqueeze
(
1
)
# 4. Transformer blocks
# 4. Transformer blocks
if
torch
.
is_grad_enabled
()
and
self
.
gradient_checkpointing
:
if
torch
.
is_grad_enabled
()
and
self
.
gradient_checkpointing
:
...
...
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