Add HunyuanVideo ComfyUI LoRA export#1515
Open
Calamdor wants to merge 1 commit into
Open
Conversation
Adds a one-way OT -> ComfyUI LoRA conversion for HunyuanVideo, exposed in the Convert tool (Output Format: "Comfy LoRA"). Mirrors Flux2's convert_util pattern approach. - convert_hunyuan_video_lora_to_comfyui(): normalizes the input to OMI, then fuses OT's split Q/K/V (and single-block Q/K/V/MLP) adapters into the single fused projections ComfyUI expects via convert_util.lora_qkv(_mlp)_fusion, emitting native diffusion_model.* keys (e.g. double_blocks.N.img_attn.qkv). Conditioning/embedder layers are excluded (community convention); raises a clear NotImplementedError on DoRA. Uses strict=True so unexpected keys fail loudly rather than being silently dropped. - LoRASaverMixin: single COMFY_LORA case delegating to a new overridable _get_comfy_state_dict hook (default raises NotImplementedError), so other model types are unaffected. - HunyuanVideoLoRASaver: overrides the hook to call the converter. - ConvertModelUI: adds the "Comfy LoRA" output format option. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
|
Looks good to me. I want to make this a larger PR though because Comfy has decided to stop supporting diffusers format for more models: Comfy-Org/ComfyUI#14182 The user should be able to choose output format:
For the last 2: |
dxqb
added a commit
that referenced
this pull request
Jun 14, 2026
dxqb
added a commit
that referenced
this pull request
Jun 19, 2026
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.
Redo of PR #1374
This version focused on using Flux.2 as the template for integration.
100% AI Generated code. More Spec Based programming compared to 1374.
Will close PR #1374
Very simple one way integration of HYV to ComfyUI conversion of Lora files using OneTrainer's Conversion Tool