Skip to content

[LTX-2] add Flax/JAX implementation of LTX-2 Latent Upsampler#366

Open
mbohlool wants to merge 1 commit intomainfrom
mehdy-temp-upscaler
Open

[LTX-2] add Flax/JAX implementation of LTX-2 Latent Upsampler#366
mbohlool wants to merge 1 commit intomainfrom
mehdy-temp-upscaler

Conversation

@mbohlool
Copy link
Copy Markdown
Collaborator

@mbohlool mbohlool commented Mar 26, 2026

This PR introduces support for the LTX-2 Latent Upsampler, enabling higher resolution and higher quality video generation directly within the latent space prior to VAE decoding.

Key Changes

  • Latent Upsampler Model (latent_upsampler_ltx2.py): Added a native Flax/JAX implementation of the LTX2LatentUpsamplerModel, including spatial/temporal rational resampling, pixel shuffle, and blur downsampling.
  • Weight Conversion (ltx2_utils.py): Added utilities to load, convert, and correctly transpose PyTorch upsampler weights to Flax/JAX format.
  • Pipeline Integration (ltx2_pipeline.py): Integrated the upsampler step directly into the main LTX2Pipeline. When run_latent_upsampler=True, latents are upsampled, Adaptive Instance Normalized (AdaIN), and tone-mapped before decoding.
  • Standalone Pipeline (pipeline_ltx2_latent_upsample.py): Added a dedicated FlaxLTX2LatentUpsamplePipeline for cases where users want to run the upsampler on existing latents independently of the main generation loop.
  • Config & Inference scripts: Updated ltx2_video.yml and generate_ltx2.py with necessary configuration flags to toggle and tune the upsampler (upsampler_adain_factor, upsampler_tone_map_compression_ratio, etc.).

@mbohlool mbohlool requested a review from entrpn as a code owner March 26, 2026 20:00
@github-actions
Copy link
Copy Markdown

@syhuang22
Copy link
Copy Markdown
Collaborator

Would be better to add unit test associated with upsampler.

@mbohlool mbohlool force-pushed the mehdy-temp-upscaler branch 3 times, most recently from f004237 to 1a37618 Compare March 26, 2026 21:01
@mbohlool
Copy link
Copy Markdown
Collaborator Author

Added unit test. thanks for suggestion.

entrpn
entrpn previously approved these changes Mar 27, 2026
@Perseus14
Copy link
Copy Markdown
Collaborator

LGTM!

I think the checkpointer test is failing as this PR introduces some changes for supporting Upsampler. Could you fix that?

@mbohlool mbohlool force-pushed the mehdy-temp-upscaler branch 4 times, most recently from 61d298e to db18643 Compare March 31, 2026 19:45
@mbohlool
Copy link
Copy Markdown
Collaborator Author

@entrpn @Perseus14 PTAL

@mbohlool mbohlool force-pushed the mehdy-temp-upscaler branch from db18643 to 8134d45 Compare April 2, 2026 17:30
@mbohlool mbohlool force-pushed the mehdy-temp-upscaler branch from 8134d45 to ef15200 Compare April 2, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants