Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hunyuan video attention mask dim #10454

Merged
merged 2 commits into from
Jan 6, 2025
Merged

Conversation

a-r-r-o-w
Copy link
Member

Fixes #10453

Reproducer:

import torch
from diffusers import HunyuanVideoPipeline, HunyuanVideoTransformer3DModel
from diffusers.utils import export_to_video

model_id = "hunyuanvideo-community/HunyuanVideo"
transformer = HunyuanVideoTransformer3DModel.from_pretrained(
    model_id, subfolder="transformer", torch_dtype=torch.bfloat16
)
pipe = HunyuanVideoPipeline.from_pretrained(model_id, transformer=transformer, torch_dtype=torch.float16)

# Enable memory savings
pipe.vae.enable_tiling()
pipe.enable_model_cpu_offload()

output = pipe(
    prompt="A cat walks on the grass, realistic",
    height=320,
    width=512,
    num_frames=61,
    num_inference_steps=30,
    num_videos_per_prompt=2,
).frames[0]
export_to_video(output, "output.mp4", fps=15)
hunyuan-2.mp4
hunyuan-1.mp4

cc @Nerogar

a-r-r-o-w and others added 2 commits January 4, 2025 23:46
Co-Authored-By: Nerogar <nerogar@arcor.de>
@a-r-r-o-w a-r-r-o-w requested a review from yiyixuxu January 4, 2025 22:54
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@yiyixuxu yiyixuxu merged commit 7747b58 into main Jan 6, 2025
15 checks passed
@yiyixuxu yiyixuxu deleted the fix-hunyuan-attention-mask-dim branch January 6, 2025 20:07
DN6 pushed a commit that referenced this pull request Jan 15, 2025
* fix

* add coauthor

Co-Authored-By: Nerogar <nerogar@arcor.de>

---------

Co-authored-by: Nerogar <nerogar@arcor.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hunyuan Video does not support batch size > 1
3 participants