PyTorch API
For developers who want direct Python integration or custom workflows beyond ComfyUI, LTX-2 offers two paths: the native ltx-pipelines package (full control, all features) and the HuggingFace Diffusers integration (familiar API, quick start).
Repository Structure
The LTX-2 codebase is a monorepo with three packages:
Requirements
- Python >= 3.12
- CUDA >= 12.7
- PyTorch ~= 2.7
See System Requirements for full hardware specifications.
Installation
Download Models
LTX-2.5 ships as a split pack — one .safetensors file per component (transformer, text encoder, video/audio VAEs, duration head). The distilled text-to-video pipeline needs the files below. Download them with the Hugging Face CLI (click Agree and Access on the model page on first download):
Use the bf16 files with ltx-pipelines. The *-comfy-int8_convrot variants are ComfyUI-only and are not loaded by the PyTorch path. For the full checkpoint list (dev transformer, conv VAE, distilled LoRA, upscalers), see the LTX-2.5 model card.
Option 1: Native Pipelines (ltx-pipelines)
The ltx-pipelines package provides the most complete feature set, including two-stage generation, IC-LoRA, and fine-grained guidance control.
Available Pipelines
All pipelines also run from the command line (python -m ltx_pipelines.<module> --help). For the full module list, shared CLI flags, and a per-pipeline reference, see Installation & Usage and Available Pipelines on GitHub.
Text-to-Video Example
This runs the distilled pipeline from the command line — the same interface as the Pipeline Quick Start. Each split component is passed with its own path flag:
You can drive the same pipeline from Python, passing the split paths through ModelPaths:
Add --help to any pipeline module to see its full option list, including the guidance parameters below.
Dimension constraints: Width and height must be divisible by 32. Frame
count must follow the pattern 8n + 1 (valid values: 1, 9, 17, 25, …, 97,
105, 113, 121, etc.). Omit --num-frames to let the duration head pick a
length from the prompt (LTX-2.5+), or set it explicitly, e.g. --num-frames 121.
Guidance Parameters
The native pipelines expose MultiModalGuiderParams for fine-grained control over generation:
Memory Optimization
For consumer GPUs, reduce VRAM by running the transformer in FP8 and offloading weights to CPU — add these flags to any pipeline command:
--quantization fp8-castdowncasts the bf16 transformer on the fly and works on any FP8-capable GPU. Use the bf16 checkpoints for this — the*-comfy-int8_convrotfiles are ComfyUI-only.--quantization fp8-scaled-mmis the alternative for a native-FP8 checkpoint on Hopper+ GPUs.--offload cpustreams weights from system RAM per layer;--offload diskreads them from disk on demand (lowest memory, slower).
Additional tip: set PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to improve memory allocation.
Option 2: HuggingFace Diffusers
LTX-2.5 is published as a Diffusers-compatible pack in a separate repo, Lightricks/LTX-2.5-Diffusers — the same model in Diffusers-friendly packaging. Load it with from_pretrained against that repo id:
The Diffusers integration provides a simpler interface but may not expose all
features available in the native ltx-pipelines package (e.g., IC-LoRA,
advanced guidance parameters). For full feature access, use the native
pipelines.
For the exact pipeline class and current examples, see the Lightricks/LTX-2.5-Diffusers model card.
Generation Parameters Reference
Resolution
Standard aspect ratios:
Higher resolutions are supported (up to 4K) but require significantly more VRAM. Start with lower resolutions for testing.