Repository navigation
[LoRA] support musubi-tuner HunyuanVideo LoRAs - #15346
Merged
Merged
Conversation
…st to the pipeline LoRA tests
chsu-amd
marked this pull request as ready for review
November 19, 2026 03:51
sayakpaul
reviewed
Nov 19, 2026
| class TestHunyuanVideoPipelineLoRA(HunyuanVideoPipelineTesterConfig, LoraTesterMixin): | ||
| """LoRA tests for the HunyuanVideo pipeline.""" | ||
|
|
||
| def test_lora_musubi_state_dict(self, base_pipe_output): |
sayakpaul
approved these changes
Nov 19, 2026
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #15344
HunyuanVideo LoRAs trained with musubi-tuner (keys like
lora_unet_double_blocks_0_img_attn_qkv.lora_down.weight/.lora_up.weight/.alpha, e.g.lucataco/hunyuan-steamboat-willie-10from the HunyuanVideo docs) were sent to_convert_hunyuan_video_lora_to_diffusers, which callschunk(3)on the 0-dim.alphaand fails.This PR adds
_convert_musubi_hunyuan_video_lora_to_diffusers, following_convert_musubi_wan_lora_to_diffusers(#11243): it renames the musubi keys to the original HunyuanVideo layout, foldsalpha / rankinto the weights, and hands the result to the existing converter.HunyuanVideoLoraLoaderMixin.lora_state_dictuses it when a key starts withlora_unet_, the same check as the Wan loader.With the fix, the snippet from #15344 prints
1040 keys, and every converted key matches the shape of its module in the full-sizeHunyuanVideoTransformer3DModel(built from thehunyuanvideo-community/HunyuanVideoconfig on the meta device: 520 modules, 0 missing, 0 shape mismatches).Tests: per review, no new unit test.
tests/pipelines/hunyuan_video/test_hunyuan_video.py+tests/models/transformers/test_models_transformer_hunyuan_video.pypass on CPU (109 passed, 129 skipped, 1 xpassed, with the since-removed musubi test).ruff check/ruff format --check(0.9.10) pass on the changed files.Self-review notes (the
self-reviewskill's rubric:review-rules.md,code_style.md,testing.md):https://huggingface.co/...URL toload_lora_weights, which fails earlier withHFValidationError(noted in HunyuanVideo:lora_state_dict/load_lora_weightscrash on musubi-tuner (kohya-style) LoRAs #15344); this PR leaves the docs as they are, happy to switch them to the repo id here if you prefer.Before submitting
self-reviewskill on the diff?lora_state_dict/load_lora_weightscrash on musubi-tuner (kohya-style) LoRAs #15344documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@sayakpaul