Skip to content

Add from_single_file support for HunyuanVideo15Transformer3DModel#13953

Open
HaozheZhang6 wants to merge 1 commit into
huggingface:mainfrom
HaozheZhang6:hunyuanvideo15-single-file
Open

Add from_single_file support for HunyuanVideo15Transformer3DModel#13953
HaozheZhang6 wants to merge 1 commit into
huggingface:mainfrom
HaozheZhang6:hunyuanvideo15-single-file

Conversation

@HaozheZhang6

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds from_single_file support for HunyuanVideo15Transformer3DModel so the community HunyuanVideo-1.5 GGUF builds (jayn7's I2V/T2V 480p/720p, a few thousand downloads) load directly.

The converter ports the mapping in the repo's own scripts/convert_hunyuan_video1_5_to_diffusers.py into from_single_file form. The single-file GGUF stores fused img_attn_qkv / txt_attn_qkv, so those are split (to_q/k/v and add_q/k/v_proj) the same way convert_hunyuan_video_transformer_to_diffusers does. num_layers / num_refiner_layers are read from the checkpoint, so it covers the 480p/720p/t2v/i2v variants.

Checked against a real HunyuanVideo-1.5-I2V-720p GGUF (1361 tensors): every source key is consumed and the result maps onto the model with 0 missing / 0 unexpected / 0 shape mismatch (1361 → 1801 keys after the qkv splits).

Before submitting

  • Did you use an AI agent (Claude Code) to help with this PR? Yes.
    • Pointed it at .ai/ — read AGENTS.md and review-rules.md.
    • Self-reviewed the diff against .ai/review-rules.md.
  • Did you read the contributor guideline?
  • Was this discussed via a GitHub issue? No — follows the existing single_file pattern; happy to open one if you'd prefer.

Who can review?

@DN6

Ports the repo's own scripts/convert_hunyuan_video1_5_to_diffusers.py mapping
into a from_single_file checkpoint converter. The single-file GGUF stores fused
img/txt attention qkv, which is split here. Lets the community HunyuanVideo-1.5
GGUF builds load directly. num_layers / num_refiner_layers are derived from the
checkpoint so it covers the 480p/720p/t2v/i2v variants.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added single-file size/L PR with diff > 200 LOC labels Jun 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @HaozheZhang6, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Fixes #1234) to the PR description so the issue is linked. See the contribution guide for more details. If this PR intentionally does not fix a tracked issue, a maintainer can add the no-issue-needed label to silence this reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

single-file size/L PR with diff > 200 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant