[Model] Add two stages inference for model LTX-2 distilled.#2260
Conversation
9551a1b to
32b1d20
Compare
There was a problem hiding this comment.
💡 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".
28df8a8 to
8a21b38
Compare
|
@david6666666 PTAL! Thanks! |
|
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. |
8a21b38 to
bdec48c
Compare
david6666666
left a comment
There was a problem hiding this comment.
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.
429876c to
793d43c
Compare
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. |
|
@SamitHuang help take a look, thx |
1a9de72 to
564075f
Compare
|
@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>
|
@lishunyang12 @SamitHuang @wtomin This PR is ready. PTAL, thanks! 😊 |
…ject#2260) Signed-off-by: Songrui625 <songrui625@gmail.com> Signed-off-by: JuanPZuluaga <juanz9312@gmal.com>
…ject#2260) Signed-off-by: Songrui625 <songrui625@gmail.com>
…ject#2260) Signed-off-by: Songrui625 <songrui625@gmail.com>
…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>
…ject#2260) Signed-off-by: Songrui625 <songrui625@gmail.com>
…ject#2260) Signed-off-by: Songrui625 <songrui625@gmail.com>
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) andLTX2ImageToVideoTwoStagesPipeline(for I2V) to do this. The pipeline is composed of two stages: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-class-nameto valueLTX2TwoStagesPipeline(for T2V) orLTX2ImageToVideoTwoStagesPipeline(for I2V)--guidance-scaleto value 1.0Test 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
LTX-2 distilled T2V two stages sample
Image-To-Video
LTX-2 distilled I2V single stage sample
LTX-2 distilled I2V two stages sample
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.pyandimage_to_video.pyboth with option '--enforce-eager' on NVIDIA H20.Sampling Parameters:
Future Work
Lightricks/LTX-2could apply two stages inferenceEssential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model. Please runmkdocs serveto sync the documentation editions to./docs.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)