Overview of ltx-pipelines
mainltx-pipelines package provides minimal model-loading utilities that are required for performing TurboT2AV inference.repository·main·Indexed 25 days ago
https://github.com/thu-ml/turbodiffusionA video generation acceleration framework that speeds up end-to-end diffusion generation by 100-205x with negligible quality loss. It utilizes SageAttention, Sparse-Linear Attention (SLA), and rCM timestep distillation. The framework supports Text-to-Video (T2V) and Image-to-Video (I2V) inference with models like TurboWan2.1 and TurboWan2.2 at 480p and 720p resolutions, and includes a TUI server for interactive generation.
ltx-pipelines package provides minimal model-loading utilities that are required for performing TurboT2AV inference.ltx-core is the foundational library for the LTX-2 Audio-Video generation model, providing modular components for constructing inference flows. Key modules include:
Modality format.LTX2Scheduler, LinearQuadratic, and Beta.CFG, STG, and APG.[B, C, F, H, W] and sequence format [B, seq_len, dim]..safetensors loading, LoRA fusion, and memory management.The core of LTX-2 is an asymmetric dual-stream diffusion transformer with 48 layers. It processes video and audio tokens simultaneously, allocating 14B parameters to the video stream and 5B parameters to the audio stream.
Each dual-stream block performs four sequential operations:
For actual model loading and initialization, use the ltx-pipelines package.
You can install ltx-core either from the repository root using uv or by installing it as an editable package via pip.
# From the repository root
uv sync --frozen
# Or install as a package
pip install -e packages/ltx-corepython>=3.9torch>=2.7.0 (Note: torch==2.8.0 is recommended to avoid OOM issues).conda create -n turbodiffusion python=3.12
conda activate turbodiffusion
pip install turbodiffusion --no-build-isolationgit clone https://github.com/thu-ml/TurboDiffusion.git
cd TurboDiffusion
git submodule update --init --recursive
pip install -e . --no-build-isolationconda create -n turbodiffusion python=3.12
conda activate turbodiffusion
pip install turbodiffusion --no-build-isolationTo install the required dependencies for the recommended SageSLA + FastNorm + TileLang W8A8 inference path, navigate to the TurboDiffusion/TurboT2AV/LTX-2 directory and run the following commands. This installs local LTX packages, CUDA 12.8 PyTorch, SageAttention, SpargeAttn, and TileLang.
cd TurboDiffusion/TurboT2AV/LTX-2
pixi install
pixi run install-accelerationIf you are a developer, you can run the unit test suite in the development environment. This task installs CUDA 12.8 PyTorch and the local LTX packages before running the tests. Inference-only users do not need to perform this step.
pixi run -e dev testThe complete generation process follows these conceptual steps:
[B, C, F, H, W].[B, seq_len, dim].The TurboDiffusion TUI Server provides an interactive text-based interface for video generation. It loads models once and keeps them GPU-resident for multiple generations. You can launch it using three different methods:
pip install -e .).--serve flag to specific Wan2.1 or Wan2.2 scripts.# 1. Python module
PYTHONPATH=turbodiffusion python -m turbodiffusion.serve [args]
# 2. Installed CLI
PYTHONPATH=turbodiffusion turbodiffusion-serve [args]
# 3. Via existing inference scripts
PYTHONPATH=turbodiffusion python turbodiffusion/inference/wan2.1_t2v_infer.py --serve [args]
PYTHONPATH=turbodiffusion python turbodiffusion/inference/wan2.2_i2v_infer.py --serve [args]Choose your checkpoint and command flags based on your GPU memory:
High Memory GPUs (e.g., H100, >40GB VRAM):
-quant in the filename).--quant_linear flag from your command.Consumer GPUs (e.g., RTX 5090, RTX 4090):
-quant in the filename).--quant_linear flag to your command.Follow these steps during an active TUI session to generate video:
\ at the end of a line to continue the prompt on the next line.> A cat sitting on a windowsill \
... watching the rain fall outside
output [output/generated_video.mp4]:
Generating video...
Done: output/generated_video.mp4Weights for TurboT2AV, LTX-2, and Gemma-3 can be downloaded using pixi run hf download.
Note: Gemma is a gated Hugging Face model. You must accept the access terms on its Hugging Face page and export your token first:
export HF_TOKEN=your_huggingface_tokenpixi run hf download Lightricks/LTX-2 ltx-2-19b-dev.safetensors --local-dir /path/to/checkpoints/LTX-2
pixi run hf download google/gemma-3-12b-it-qat-q4_0-unquantized --local-dir /path/to/checkpoints/gemma-3-12b-it-qat-q4_0-unquantizedpixi run hf download luyu1021/TurboT2AV \
--include "checkpoints/turbot2av_main/*" \
--local-dir /path/to/turbo-t2av-weights