Skip to content

feat: add portable LTX-2.5 audio-video inference - #1602

Draft
NancyFyong wants to merge 1 commit into
modelscope:mainfrom
NancyFyong:ltx2_5
Draft

feat: add portable LTX-2.5 audio-video inference#1602
NancyFyong wants to merge 1 commit into
modelscope:mainfrom
NancyFyong:ltx2_5

Conversation

@NancyFyong

@NancyFyong NancyFyong commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Scope

This PR adds LTX-2.5 inference only. It does not add training support or model weights.

Implemented inference

  • local split-checkpoint loading for the LTX-2.5 22B Distilled and Dev packs
  • LTX-specific Gemma 4 prompt encoding, packed tokenizer, audio/video connector modules, duration head, model registrations, and checkpoint converters
  • portable pure-PyTorch eager DiffVAE decoding with no runtime ltx_core, NATTEN, Triton, or Blackwell-DSL dependency
  • fine-grained CPU FP8 offload for Gemma4, text connectors, and DiffVAE; the low-VRAM examples expose LTX25_VRAM_LIMIT_GB
  • LTX25AudioVideoPipeline and a low-VRAM distilled T2AV example
  • automatic duration prediction when num_frames is omitted
  • Distilled two-stage T2AV and I2AV
  • Dev one-stage T2AV and I2AV
  • Dev two-stage T2AV and I2AV using the distilled stage-2 LoRA
  • A2V and video/audio Retake
  • multi-image keyframe interpolation through input_images and input_images_indexes
  • official Pixel Spatial Upscaler IC-LoRA inference

Validation

  • python -m py_compile for added and changed Python sources
  • 407-key DiffVAE meta-device state-dict contract
  • fixed-input upstream comparison under matched eager attention and SwiGLU:
    • deterministic decoder stages 1-3: max_diff=0.0
    • deterministic decoder stage 4: max_diff=0.0
    • stage-5 x0 diffusion step: max_diff=0.0
    • full decoder output maximum absolute difference: 2.98e-08
  • legacy LTX-2/2.3 DiT meta-device regression check
  • full-resolution inference validation for every mode listed below
  • 960×576×121 distilled T2AV with LTX25_VRAM_LIMIT_GB=16: 31.8 GiB peak allocated and 44.4 GiB peak reserved

Inference samples

All samples below are real full-resolution inference outputs: 960×576, 121 frames at 24 FPS, 5.041667 seconds, H.264 video, and 48 kHz stereo AAC audio. The GIF previews link to their original MP4s. SHA-256 and ffprobe metadata are stored in the fork sample PR #1.

P0 Distilled T2AV P1 Distilled I2AV
P0 Distilled T2AV
P0 Distilled T2AV
P1 Distilled I2AV
P1 Distilled I2AV
Dev one-stage T2AV Dev one-stage I2AV
Dev one-stage T2AV
Dev one-stage T2AV
Dev one-stage I2AV
Dev one-stage I2AV
Dev two-stage T2AV Dev two-stage I2AV
Dev two-stage T2AV
Dev two-stage T2AV
Dev two-stage I2AV
Dev two-stage I2AV
A2V Retake
A2V
A2V
Retake
Retake
Keyframe interpolation Pixel Spatial Upscaler IC-LoRA
Keyframe interpolation
Keyframe interpolation
Pixel Spatial Upscaler IC-LoRA
Pixel Spatial Upscaler IC-LoRA

Only full-resolution results are shown. In-context IC-LoRA is not shown because the separately gated official adapter is unavailable.

Not included

The following official LTX workflows are not implemented by this PR and are not claimed as supported:

  • DFR
  • Dub-It
  • HDR/EXR workflows
  • training or fine-tuning

The repository contains no checkpoint files, generated media, isolated environments, or authenticated inspection logs. Sample media is published separately in the fork sample PR linked above.

@Artiprocher

Copy link
Copy Markdown
Collaborator

@NancyFyong

Thank you very much for your contribution to this open-source project. We truly appreciate your effort and interest. However, we are unable to merge this pull request at this time for the following reasons:

  • The LTX-2.3 model implementation in DiffSynth-Studio has recently undergone significant refactoring. The code in this PR is now somewhat outdated and overly verbose. To maintain a clean and maintainable codebase, we aim to keep the framework as concise as possible, rather than adopting a "just make it work" approach. We would kindly ask that the model code be refactored accordingly.
  • This PR also includes several earlier changes, which have resulted in merge conflicts across multiple files. Please resolve these conflicts before we can proceed with the review.

Due to limited maintainer bandwidth, we anticipate a delay in integrating support for LTX-2.5. If you are willing, we would be happy for you to update this PR to address the above points. Alternatively, please feel free to wait, and we will incorporate the necessary changes ourselves when resources allow.

Thank you again for your understanding and continued support!

@NancyFyong

Copy link
Copy Markdown
Contributor Author

@NancyFyong

Thank you very much for your contribution to this open-source project. We truly appreciate your effort and interest. However, we are unable to merge this pull request at this time for the following reasons:

  • The LTX-2.3 model implementation in DiffSynth-Studio has recently undergone significant refactoring. The code in this PR is now somewhat outdated and overly verbose. To maintain a clean and maintainable codebase, we aim to keep the framework as concise as possible, rather than adopting a "just make it work" approach. We would kindly ask that the model code be refactored accordingly.
  • This PR also includes several earlier changes, which have resulted in merge conflicts across multiple files. Please resolve these conflicts before we can proceed with the review.

Due to limited maintainer bandwidth, we anticipate a delay in integrating support for LTX-2.5. If you are willing, we would be happy for you to update this PR to address the above points. Alternatively, please feel free to wait, and we will incorporate the necessary changes ourselves when resources allow.

Thank you again for your understanding and continued support!

Thank you for the detailed feedback. I'll address the issues you mentioned. This PR is still under active development, and I'll resolve the merge conflicts and refactor the model code in line with the recent LTX-2.3 changes as soon as possible.

@NancyFyong

Copy link
Copy Markdown
Contributor Author

Thank you for the review. I have updated this draft:

  • rebased it onto the current main; it now has one focused LTX-2.5 commit and is mergeable without conflicts
  • removed inherited unrelated changes
  • reduced the DiffVAE port to the verified pure-PyTorch eager path, removing unused tiling schedulers, optional backend paths, and NATTEN/Triton/Blackwell-DSL/runtime ltx_core code
  • reran the checkpoint contract, pure-eager upstream parity, and media smoke validations

The revised PR description includes the precise scope and validation results. Thank you again for considering the updated implementation.

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.

3 participants