Skip to content

[LTX2] Fix from_single_file: missing 2.3 key mappings and shared checkpoint dict draining#14151

Open
Functionhx wants to merge 1 commit into
huggingface:mainfrom
Functionhx:fix/ltx2-single-file
Open

[LTX2] Fix from_single_file: missing 2.3 key mappings and shared checkpoint dict draining#14151
Functionhx wants to merge 1 commit into
huggingface:mainfrom
Functionhx:fix/ltx2-single-file

Conversation

@Functionhx

@Functionhx Functionhx commented Jul 9, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes #14145.

Two bugs in LTX2 single_file loading:

  1. LTX 2.3 checkpoints have prompt_adaln_single and audio_prompt_adaln_single keys that were missing from the key remapping. Added handlers with early returns (more specific than the existing adaln_single handlers). Also added up_blocks.7 and up_blocks.8 entries to the VAE rename dict.

  2. All three converters were popping ALL keys from the shared checkpoint dict instead of filtering by their component prefix. Fixed by scoping to model.diffusion_model., vae., and audio_vae. prefixes respectively.

Before submitting

  • Read the contributor guideline
  • Discussed via GitHub issue
  • This PR adds a new model/pipeline — No
  • New tests — No, this is a targeted bug fix
  • Documentation — No changes needed

AI agent disclosure

  • Did you use an AI agent? Yes (code review and verification)
  • Did you read the Coding with AI agents guide? Yes
  • Did you self-review against .ai/review-rules.md? Yes

Who can review?

Anyone in the community.

…oint dict draining

Two independent bugs in the LTX2 single-file converters:

Bug 1: Missing LTX 2.3 key mappings.
- convert_ltx2_transformer_to_diffusers did not map the 2.3
  prompt_adaln_single and audio_prompt_adaln_single modulation keys,
  leaving prompt_adaln/audio_prompt_adaln modules as meta tensors.
- convert_ltx2_vae_to_diffusers did not map the 2.3 decoder
  up_blocks.7/up_blocks.8 keys.

Bug 2: Each LTX2 converter consumed the entire checkpoint dict via
checkpoint.pop(), so only the first component got weights and later
components received an empty dict. Fixed by filtering to each
converter's own key prefix (model.diffusion_model./vae./audio_vae.),
falling back to all keys when the prefix is absent for single-component
extraction.

Fixes huggingface#14145.

Test Plan:
Verified key parity for both LTX 2.0 and 2.3 checkpoints:
- LTX 2.3: transformer 4186/4186, vae 170/170, audio_vae 102/102
- LTX 2.0: transformer 3510/3510, vae 184/184, audio_vae 102/102
No missing or unexpected keys in any component.

Signed-off-by: Functionhx <2994114386@qq.com>
Signed-off-by: Yuchen Fan <functionhx@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

1 participant