Skip to content

Deprecate output_type="latent" in modular decoders - #15078

Open
dhvani7014 wants to merge 4 commits into
huggingface:mainfrom
dhvani7014:fix-15071-latent
Open

dhvani7014 wants to merge 4 commits into
huggingface:mainfrom
dhvani7014:fix-15071-latent

Conversation

@dhvani7014

@dhvani7014 dhvani7014 commented Oct 19, 2026 •

Copy link
Copy Markdown

What does this PR do?

Fixes #15071

Deprecates the output_type == "latent" branches in the modular decode blocks for flux, sd3, sdxl, cosmos and echo, targeting removal in 0.47.0 alongside the packed-latents deprecation from #14737. Latents are available via output="latents" instead. ltx2 is left for #14612.

Self-review notes

  • Passing output_type="latent" to these decoders still returns the latents as before, but now emits a FutureWarning (via deprecate, 0.47.0) pointing to output="latents".
  • Any other output_type not in ("pil", "np", "pt") raises a ValueError, same as minimax_h3.
  • Rebased onto main after move unpack out of the flux, krea2 and ltx decoders into the core denoise groups聽#14737 merged and kept its packed-latents deprecation in the flux decoder.
  • Tests that used "latent" now read latents/audio_latents from the output or use output_type="pt". Added a flux test that checks the deprecation warning and that the latents come back unchanged.
  • Updated the echo docs line that described the latent output.
  • Ran make style and pytest on tests/modular_pipelines/{flux,echo,stable_diffusion_3,stable_diffusion_xl}: 211 passed, 28 skipped. The 2 SDXL test_to_device failures also fail on main on my Mac (MPS), so they're unrelated.

Before submitting

Who can review?

@yiyixuxu

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests modular-pipelines fixes-issue size/L PR with diff > 200 LOC labels Oct 19, 2026
@dhvani7014

Copy link
Copy Markdown
Author

Hi @yiyixuxu, could you please review this PR whenever you get a chance? I'd really appreciate your feedback. Thank you!

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

@yiyixuxu yiyixuxu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!
i left a comment

Comment thread src/diffusers/modular_pipelines/cosmos/decoders.py Outdated
@dhvani7014 dhvani7014 changed the title Remove output_type="latent" from modular decoders Deprecate output_type="latent" in modular decoders Oct 22, 2026
@dhvani7014

dhvani7014 commented Oct 22, 2026 •

Copy link
Copy Markdown
Author

@yiyixuxu Done, switched to a deprecation targeting 0.47.0, matching #14737. Also rebased onto main and added a test for the warning

@dhvani7014
dhvani7014 requested a review from yiyixuxu October 22, 2026 05:26
@dhvani7014

Copy link
Copy Markdown
Author

Hi @yiyixuxu, just a gentle ping on this one when you have time. I switched to the deprecation as you suggested. Let me know if anything else needs changing!

Comment thread docs/source/en/api/pipelines/echo.md
Comment thread src/diffusers/modular_pipelines/cosmos/decoders.py Outdated
Comment thread src/diffusers/modular_pipelines/cosmos/decoders.py Outdated
@dhvani7014

Copy link
Copy Markdown
Author

Thanks @yiyixuxu! Updated the deprecation message, removed the extra output_type check (kept just the deprecate in all the decoders), and added a line in echo.md on getting the denormalized VAE tensors without decoding.

This branch has not been deployed

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

Labels

documentation Improvements or additions to documentation fixes-issue modular-pipelines size/L PR with diff > 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-up to #14737: drop output_type="latent" from modular decode blocks

3 participants