Skip to content

Teacache implemented into hunyuan video framepack transformer model #11949

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AChowdhury1211
Copy link
Contributor

@AChowdhury1211 AChowdhury1211 commented Jul 17, 2025

What does this PR do?

  • This PR adds TeaCache support to HunyuanVideoFramepackTransformer3DModel, improving inference latency.

TeaCache is opt-in and can be enabled with:

transformer = HunyuanVideoFramepackTransformer3DModel.from_pretrained(
    "lllyasviel/FramePackI2V_HY", torch_dtype=torch.bfloat16
)
transformer.initialize_teacache()

What’s changed

  • Added TeaCache logic in the model’s forward method.
  • Introduced initialize_teacache() method.
  • Wrote an initialization test inside the existing test for Hunyuan FramePack.

Let me know the fixes required

@AChowdhury1211
Copy link
Contributor Author

@sayakpaul @yiyixuxu

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.

1 participant