Skip to content

[Model] Add two stages inference for model LTX-2 distilled.#2260

Merged
david6666666 merged 16 commits into
vllm-project:mainfrom
Songrui625:ltx2-2-stage
Apr 3, 2026
Merged

[Model] Add two stages inference for model LTX-2 distilled.#2260
david6666666 merged 16 commits into
vllm-project:mainfrom
Songrui625:ltx2-2-stage

Conversation

@Songrui625
Copy link
Copy Markdown
Contributor

@Songrui625 Songrui625 commented Mar 27, 2026

PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.

Purpose

This PR add two stages inference for model LTX-2 refer to huggingface/diffusers#12934

Two stages inference is recommended approach to achieve production quality generation, we provide LTX2TwoStagesPipeline (for T2V) and LTX2ImageToVideoTwoStagesPipeline (for I2V) to do this. The pipeline is composed of two stages:

Stage 1: Generate a video at the target resolution using diffusion sampling with classifier-free guidance (CFG). This stage produces a coherent low-noise video sequence that respects the text/image conditioning.
Stage 2: Upsample the Stage 1 output by 2 and refine details using a distilled LoRA model to improve fidelity and visual quality. Stage 2 may apply lighter CFG to preserve the structure from Stage 1 while enhancing texture and sharpness.

For now it only supported distilled model rootonchair/LTX-2-19b-distilled. The distilled LoRA model ltx-2-19b-distilled-lora-384.safetensors is in the main repo but doesn't have the related adpater config, which cause we couldn't load it directly.

How to use

  • model: rootonchair/LTX-2-19b-distilled
  • Set option --model-class-name to value LTX2TwoStagesPipeline (for T2V) or LTX2ImageToVideoTwoStagesPipeline (for I2V)
  • Set option --guidance-scale to value 1.0

Test Plan

Regression tests are all passed to make sure no breaking change. And we also need to bench the acceleration methods for two stages pipeline.

Text-To-Video

LTX-2 distilled T2V single stage sample
python3 text_to_video.py --model /data00/models/LTX-2-19b-distilled --prompt 'A close-up shot of a young waitress in a retro 1950s diner, her warm brown eyes meeting the camera with a gentle smile. She wears a black polka-dot dress with an elegant cream lace collar, her reddish-brown hair styled in an elaborate updo with delicate curls framing her freckled face. Soft, warm light from overhead fixtures illuminates her features as she stands behind a yellow counter. The camera begins slightly to her side, then slowly pushes in toward her face, revealing the subtle rosy blush on her cheeks. In the blurred background, the soft teal walls and a glowing red "Diner" sign create a nostalgic atmosphere. The ambient sounds of clinking dishes, distant conversations, and the gentle hum of a jukebox fill the air. She tilts her head slightly and says in a friendly, warm voice: "Welcome to Rosie'\''s. What can I get for you today?" The mood is inviting, timeless, and full of classic American diner charm.' --negative-prompt "shaky, glitchy, low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, transition, static." --guidance-scale 1.0 --width 768 --height 512 --num-inference-steps 8 --num-frames 121 --frame-rate 24 --seed 42 --enforce-eager --output ltx2_t2v_sample.mp4
LTX-2 distilled T2V two stages sample
python3 text_to_video.py --model /data00/models/LTX-2-19b-distilled --model-class-name LTX2TwoStagesPipeline --prompt 'A close-up shot of a young waitress in a retro 1950s diner, her warm brown eyes meeting the camera with a gentle smile. She wears a black polka-dot dress with an elegant cream lace collar, her reddish-brown hair styled in an elaborate updo with delicate curls framing her freckled face. Soft, warm light from overhead fixtures illuminates her features as she stands behind a yellow counter. The camera begins slightly to her side, then slowly pushes in toward her face, revealing the subtle rosy blush on her cheeks. In the blurred background, the soft teal walls and a glowing red "Diner" sign create a nostalgic atmosphere. The ambient sounds of clinking dishes, distant conversations, and the gentle hum of a jukebox fill the air. She tilts her head slightly and says in a friendly, warm voice: "Welcome to Rosie'\''s. What can I get for you today?" The mood is inviting, timeless, and full of classic American diner charm.' --negative-prompt "shaky, glitchy, low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, transition, static." --guidance-scale 1.0 --width 768 --height 512 --num-inference-steps 8 --num-frames 121 --frame-rate 24 --seed 42 --enforce-eager --output ltx2_t2v_2st_sample.mp4

Image-To-Video

LTX-2 distilled I2V single stage sample
python3 image_to_video.py --model /data00/models/LTX-2-19b-distilled --image /data00/ltx2_i2v_input.png --model-class-name LTX2ImageToVideoTwoStagesPipeline --prompt "A close-up shot of a young waitress in a retro 1950s diner, her warm brown eyes meeting the camera with a gentle smile. She wears a black polka-dot dress with an elegant cream lace collar, her reddish-brown hair styled in an elaborate updo with delicate curls framing her freckled face. Soft, warm light from overhead fixtures illuminates her features as she stands behind a yellow counter. The camera begins slightly to her side, then slowly pushes in toward her face, revealing the subtle rosy blush on her cheeks. In the blurred background, the soft teal walls and a glowing red \"Diner\" sign create a nostalgic atmosphere. The ambient sounds of clinking dishes, distant conversations, and the gentle hum of a jukebox fill the air. She tilts her head slightly and says in a friendly, warm voice: \"Welcome to Rosie's. What can I get for you today?\" The mood is inviting, timeless, and full of classic American diner charm." --negative-prompt "shaky, glitchy, low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, transition, static." --guidance-scale 1.0 --width 768 --height 512 --num-inference-steps 8 --num-frames 121 --fps 24 --seed 45 --enforce-eager --output ltx2_i2v_2st_sample.mp4
LTX-2 distilled I2V two stages sample
python3 image_to_video.py --model /data00/models/LTX-2-19b-distilled --image /data00/ltx2_i2v_input.png --model-class-name LTX2ImageToVideoPipeline --prompt "A close-up shot of a young waitress in a retro 1950s diner, her warm brown eyes meeting the camera with a gentle smile. She wears a black polka-dot dress with an elegant cream lace collar, her reddish-brown hair styled in an elaborate updo with delicate curls framing her freckled face. Soft, warm light from overhead fixtures illuminates her features as she stands behind a yellow counter. The camera begins slightly to her side, then slowly pushes in toward her face, revealing the subtle rosy blush on her cheeks. In the blurred background, the soft teal walls and a glowing red \"Diner\" sign create a nostalgic atmosphere. The ambient sounds of clinking dishes, distant conversations, and the gentle hum of a jukebox fill the air. She tilts her head slightly and says in a friendly, warm voice: \"Welcome to Rosie's. What can I get for you today?\" The mood is inviting, timeless, and full of classic American diner charm." --negative-prompt "shaky, glitchy, low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, transition, static." --guidance-scale 1.0 --width 768 --height 512 --num-inference-steps 8 --num-frames 121 --fps 24 --seed 45 --enforce-eager --output ltx2_i2v_sample.mp4

Test Result

Text-To-Video

single stage inference:

ltx2_t2v_sample.mp4

two stages inference

ltx2_t2v_2st_sample.mp4

Image-To-Video

single stage inference:

ltx2_i2v_sample.mp4

two stages inference:

ltx2_i2v_2st_sample.mp4

Benchmark

We bench it by text_to_video.py and image_to_video.py both with option '--enforce-eager' on NVIDIA H20.

Sampling Parameters:

  • model: rootonchair/LTX-2-19b-distilled
  • prompt: A close-up shot of a young waitress in a retro 1950s diner, her warm brown eyes meeting the camera with a gentle smile. She wears a black polka-dot dress with an elegant cream lace collar, her reddish-brown hair styled in an elaborate updo with delicate curls framing her freckled face. Soft, warm light from overhead fixtures illuminates her features as she stands behind a yellow counter. The camera begins slightly to her side, then slowly pushes in toward her face, revealing the subtle rosy blush on her cheeks. In the blurred background, the soft teal walls and a glowing red "Diner" sign create a nostalgic atmosphere. The ambient sounds of clinking dishes, distant conversations, and the gentle hum of a jukebox fill the air. She tilts her head slightly and says in a friendly, warm voice: "Welcome to Rosie's. What can I get for you today?" The mood is inviting, timeless, and full of classic American diner charm.
  • width: 768
  • height: 512
  • guidance_scale: 1.0
  • num_frames: 121
  • frame_rate: 24
  • seed: 45
  • image(for I2V):
    ltx2_i2v_input
Cache-Dit Ulysses-SP 2 Ring Attention 2 CFG Parallel 2
Text-To-Video(LTX2TwoStatgesPipeline) 49.5590 s 31.7546s 31.4847s 51.3056 s
Image-To-Video(LTX2ImageToVideoTwoStatgesPipeline) 52.7701 s 32.0508 s 34.0860 s 52.6714 s

Future Work

  • L4 E2E test for LTX-2
  • Distilled LoRA support that Lightricks/LTX-2 could apply two stages inference

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan. Please provide the test scripts & test commands. Please state the reasons if your codes don't require additional test scripts. For test file guidelines, please check the test style doc
  • The test results. Please paste the results comparison before and after, or the e2e results.
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model. Please run mkdocs serve to sync the documentation editions to ./docs.
  • (Optional) Release notes update. If your change is user-facing, please update the release notes draft.

BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9551a1b24d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread vllm_omni/diffusion/models/ltx2/pipeline_ltx2.py Outdated
Comment thread vllm_omni/diffusion/models/ltx2/pipeline_ltx2.py
Comment thread vllm_omni/diffusion/models/ltx2/pipeline_ltx2.py
@Songrui625 Songrui625 force-pushed the ltx2-2-stage branch 2 times, most recently from 28df8a8 to 8a21b38 Compare March 27, 2026 08:50
@Songrui625
Copy link
Copy Markdown
Contributor Author

@david6666666 PTAL! Thanks!

@lishunyang12
Copy link
Copy Markdown
Collaborator

please open a new RFC and attach your design doc using this template in your RFC

@Songrui625
Copy link
Copy Markdown
Contributor Author

Songrui625 commented Mar 27, 2026

please open a new RFC and attach your design doc using this template in your RFC

Sorry to bother you. This PR is more of a model-related implementation than a new feature. I have already changed both the PR title and commit title.

@Songrui625 Songrui625 changed the title [Feature] Add two stages inference for model LTX-2 distilled. [Model] Add two stages inference for model LTX-2 distilled. Mar 27, 2026
Copy link
Copy Markdown
Collaborator

@david6666666 david6666666 left a comment

Choose a reason for hiding this comment

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

I believe we need to test all acceleration methods of LTX-2 T2V and I2V to ensure functionality is unaffected. Alternatively, we could add an E2E L4 level test for monitoring, similar to #2087.

Comment thread vllm_omni/diffusion/models/ltx2/pipeline_ltx2_image2video.py Outdated
Comment thread vllm_omni/diffusion/models/ltx2/pipeline_ltx2.py Outdated
@Songrui625 Songrui625 force-pushed the ltx2-2-stage branch 6 times, most recently from 429876c to 793d43c Compare March 31, 2026 08:48
@Songrui625
Copy link
Copy Markdown
Contributor Author

I believe we need to test all acceleration methods of LTX-2 T2V and I2V to ensure functionality is unaffected. Alternatively, we could add an E2E L4 level test for monitoring, similar to #2087.

Thanks, David, all acceleration methods regression tests (Ulysses-SP, Ring Attention, Cache-DiT and CFG-Parallel) are passed. And I have attached the benchmark results of two stages pipeline in the PR description. PTAL again.

@Songrui625 Songrui625 requested a review from david6666666 March 31, 2026 08:52
@david6666666
Copy link
Copy Markdown
Collaborator

@SamitHuang help take a look, thx

@Songrui625 Songrui625 force-pushed the ltx2-2-stage branch 4 times, most recently from 1a9de72 to 564075f Compare April 1, 2026 07:58
@Songrui625
Copy link
Copy Markdown
Contributor Author

@SamitHuang Hi, this PR is ready to go on. Please take a look, thanks!

Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
…2ImageToVideoTwoStagesPipeline`

Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: Songrui625 <songrui625@gmail.com>
@Songrui625
Copy link
Copy Markdown
Contributor Author

@lishunyang12 @SamitHuang @wtomin This PR is ready. PTAL, thanks! 😊

Copy link
Copy Markdown
Collaborator

@lishunyang12 lishunyang12 left a comment

Choose a reason for hiding this comment

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

LGTM

@david6666666 david6666666 merged commit cd71567 into vllm-project:main Apr 3, 2026
8 checks passed
linyueqian pushed a commit to JuanPZuluaga/vllm-omni that referenced this pull request Apr 3, 2026
…ject#2260)

Signed-off-by: Songrui625 <songrui625@gmail.com>
Signed-off-by: JuanPZuluaga <juanz9312@gmal.com>
skf-1999 pushed a commit to Semmer2/vllm-omni that referenced this pull request Apr 7, 2026
vraiti pushed a commit to vraiti/vllm-omni that referenced this pull request Apr 9, 2026
@Songrui625
Copy link
Copy Markdown
Contributor Author

LGTM. Can you help to create a L4 e2e test on follow pr, covering the existing diffusion features supported (See #1217). As for how to create a L4 e2e test, please refer to #1832 .

The PR about L4 e2e tests has committed. PTAL, thanks. #2815

ultism added a commit to ultism/vllm-omni that referenced this pull request Apr 17, 2026
…s API

PR vllm-project#2309 renamed DiffusionLoRAManager.set_active_adapter (singular)
to set_active_adapters (plural) with list signatures. LTX2 distilled
stage was added to upstream in vllm-project#2260 after vllm-project#2309 branched, so its two
call sites were written against the old singular API and broke when
this branch merged upstream/main.

Wrap the single LoRARequest / scale in one-element lists to match the
new signature; behavior is identical.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: ultranationalism <www913363043@gmail.com>
lengrongfu pushed a commit to lengrongfu/vllm-omni that referenced this pull request May 1, 2026
clodaghwalsh17 pushed a commit to clodaghwalsh17/nm-vllm-omni-ent that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready label to trigger buildkite CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants