Skip to content

move unpack out of the flux, krea2 and ltx decoders into the core denoise groups - #14737

Open
akshan-main wants to merge 5 commits into
huggingface:mainfrom
akshan-main:modular-latents-form
Open

move unpack out of the flux, krea2 and ltx decoders into the core denoise groups#14737
akshan-main wants to merge 5 commits into
huggingface:mainfrom
akshan-main:modular-latents-form

Conversation

@akshan-main

@akshan-main akshan-main commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #14730.

Adds a test to the modular tester mixin that checks the shape of the latents each pipeline leaves in the state after denoising, and every tester now declares expected_latents_shape. Running it across all families catches the three from the issue, plus ltx2 (being moved in #14612, so it's declared at its current packed shape until then) and wan_animate_2, which decodes inside its segment loop and never leaves latents behind, so it opts out with latents_output_name = None.

For flux, krea2 and ltx the unpack now happens at the end of the core denoise group, same shape as Flux2UnpackLatentsStep. The decoders just denormalize and decode. They still accept packed latents with a deprecation warning, which is why height/width (and num_frames for ltx) are still on them, and there's a test per family for that path.

Outputs are identical to main on the test repos and on the real checkpoints (images in akshan-main/latents-form-verification). Loading LTX-Video with ModularPipeline.from_pretrained needs #14736. Also wrote the principle down in .ai/references/modular.md in a separate commit; feel free to drop it or change it.

Before submitting

Who can review?

@yiyixuxu

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[modular] move unpack out of the decoder blocks for flux, krea2 and ltx

1 participant