[LTX2] Fix from_single_file: missing 2.3 key mappings and shared checkpoint dict draining#14151
Open
Functionhx wants to merge 1 commit into
Open
[LTX2] Fix from_single_file: missing 2.3 key mappings and shared checkpoint dict draining#14151Functionhx wants to merge 1 commit into
Functionhx wants to merge 1 commit into
Conversation
…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>
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 #14145.
Two bugs in LTX2 single_file loading:
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.
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
AI agent disclosure
Who can review?
Anyone in the community.