# lightricks/ltx-video architecture

> Architecture diagram of the GitHub repository lightricks/ltx-video, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lightricks/ltx-video
- Repository: https://github.com/lightricks/ltx-video

## Overview

LTX-Video is a legacy text- and media-conditioned video-generation model. Users provide a prompt and optionally image/video conditioning; inference loads configured model components, then the generation pipeline samples video latents and decodes them into video. The README also describes multi-keyframe conditioning, video extension and transformation, and multi-scale generation. Edges reflect the sampled source references and README; some pipeline internals and documented capabilities are not shown in the excerpts, so their wiring is not inferred.

Main entry points: [`ltx_video/pipelines/pipeline_ltx_video.py`](https://github.com/lightricks/ltx-video/blob/main/ltx_video/pipelines/pipeline_ltx_video.py) (Video pipeline), [`ltx_video/inference.py`](https://github.com/lightricks/ltx-video/blob/main/ltx_video/inference.py) (Inference loader), [`ltx_video/models/transformers/transformer3d.py`](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/transformers/transformer3d.py) (3D transformer), [`ltx_video/models/autoencoders/causal_video_autoencoder.py`](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/causal_video_autoencoder.py) (Causal video VAE)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Inference entry"]
  node_configs["Model configs"]
  node_inference["Inference loader<br/>[inference.py]"]
end

subgraph group_generation["Generation pipeline"]
  node_pipeline["Video pipeline"]
  node_crf["CRF compressor<br/>[crf_compressor.py]"]
end

subgraph group_models["Video models"]
  node_transformer["3D transformer<br/>[transformer3d.py]"]
  node_attention["Attention blocks<br/>[attention.py]"]
  node_patchifier["Patchifier"]
  node_embeddings["Embeddings<br/>[embeddings.py]"]
  node_vae["Causal video VAE"]
  node_vae_base["VAE layers<br/>[vae.py]"]
  node_video_autoencoder["Video autoencoder"]
  node_vae_encode["VAE encoding<br/>[vae_encode.py]"]
  node_upsampler["Latent upsampler"]
end

subgraph group_support["Sampling and utilities"]
  node_scheduler["Rectified-flow scheduler<br/>[rf.py]"]
  node_prompt_enhancer["Prompt enhancement"]
  node_skip_strategy["Skip-layer strategy"]
  node_conv_factory["Convolution factory<br/>[conv_nd_factory.py]"]
  node_config_mapping["Config mapping"]
  node_torch_utils["Tensor utilities<br/>[torch_utils.py]"]
end

node_user(("User"))
node_inputs["Prompt and media"]
node_result["Generated video"]

node_user -->|"provides"| node_inputs
node_inputs -->|"submits"| node_inference
node_configs -->|"configures"| node_inference
node_inference -->|"constructs"| node_pipeline
node_inference -->|"loads"| node_vae
node_inference -->|"loads"| node_transformer
node_inference -->|"loads"| node_scheduler
node_inference -->|"loads"| node_upsampler
node_inference -->|"uses"| node_crf
node_pipeline -->|"denoises with"| node_transformer
node_pipeline -->|"steps with"| node_scheduler
node_pipeline -->|"encodes and decodes"| node_vae
node_pipeline -->|"uses"| node_vae_encode
node_pipeline -->|"uses"| node_patchifier
node_pipeline -->|"uses"| node_upsampler
node_pipeline -->|"uses"| node_prompt_enhancer
node_pipeline -->|"uses"| node_skip_strategy
node_pipeline -->|"produces"| node_result
node_transformer -->|"applies"| node_attention
node_transformer -->|"uses"| node_skip_strategy
node_vae -->|"builds on"| node_vae_base
node_vae -->|"creates convolutions"| node_conv_factory
node_video_autoencoder -->|"creates convolutions"| node_conv_factory
node_vae_base -->|"creates convolutions"| node_conv_factory
node_scheduler -->|"uses"| node_torch_utils
node_vae -->|"uses"| node_config_mapping
node_transformer -->|"uses"| node_config_mapping

click node_configs "https://github.com/lightricks/ltx-video/tree/main/configs"
click node_inference "https://github.com/lightricks/ltx-video/blob/main/ltx_video/inference.py"
click node_pipeline "https://github.com/lightricks/ltx-video/blob/main/ltx_video/pipelines/pipeline_ltx_video.py"
click node_crf "https://github.com/lightricks/ltx-video/blob/main/ltx_video/pipelines/crf_compressor.py"
click node_transformer "https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/transformers/transformer3d.py"
click node_attention "https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/transformers/attention.py"
click node_patchifier "https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/transformers/symmetric_patchifier.py"
click node_embeddings "https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/transformers/embeddings.py"
click node_vae "https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/causal_video_autoencoder.py"
click node_vae_base "https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/vae.py"
click node_video_autoencoder "https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/video_autoencoder.py"
click node_vae_encode "https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/vae_encode.py"
click node_upsampler "https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/latent_upsampler.py"
click node_scheduler "https://github.com/lightricks/ltx-video/blob/main/ltx_video/schedulers/rf.py"
click node_prompt_enhancer "https://github.com/lightricks/ltx-video/blob/main/ltx_video/utils/prompt_enhance_utils.py"
click node_skip_strategy "https://github.com/lightricks/ltx-video/blob/main/ltx_video/utils/skip_layer_strategy.py"
click node_conv_factory "https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/conv_nd_factory.py"
click node_config_mapping "https://github.com/lightricks/ltx-video/blob/main/ltx_video/utils/diffusers_config_mapping.py"
click node_torch_utils "https://github.com/lightricks/ltx-video/blob/main/ltx_video/utils/torch_utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_configs,node_inference,node_user toneBlue
class node_pipeline,node_crf toneAmber
class node_transformer,node_attention,node_patchifier,node_embeddings,node_vae,node_vae_base,node_video_autoencoder,node_vae_encode,node_upsampler toneMint
class node_scheduler,node_prompt_enhancer,node_skip_strategy,node_conv_factory,node_config_mapping,node_torch_utils toneRose
class node_inputs,node_result toneIndigo
```

## Components

### Inference entry

- [Model configs](https://github.com/lightricks/ltx-video/tree/main/configs): `configs`
- [Inference loader](https://github.com/lightricks/ltx-video/blob/main/ltx_video/inference.py): `ltx_video/inference.py`

### Generation pipeline

- [Video pipeline](https://github.com/lightricks/ltx-video/blob/main/ltx_video/pipelines/pipeline_ltx_video.py): `ltx_video/pipelines/pipeline_ltx_video.py`
- [CRF compressor](https://github.com/lightricks/ltx-video/blob/main/ltx_video/pipelines/crf_compressor.py): `ltx_video/pipelines/crf_compressor.py`

### Video models

- [3D transformer](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/transformers/transformer3d.py): `ltx_video/models/transformers/transformer3d.py`
- [Attention blocks](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/transformers/attention.py): `ltx_video/models/transformers/attention.py`
- [Patchifier](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/transformers/symmetric_patchifier.py): `ltx_video/models/transformers/symmetric_patchifier.py`
- [Embeddings](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/transformers/embeddings.py): `ltx_video/models/transformers/embeddings.py`
- [Causal video VAE](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/causal_video_autoencoder.py): `ltx_video/models/autoencoders/causal_video_autoencoder.py`
- [VAE layers](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/vae.py): `ltx_video/models/autoencoders/vae.py`
- [Video autoencoder](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/video_autoencoder.py): `ltx_video/models/autoencoders/video_autoencoder.py`
- [VAE encoding](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/vae_encode.py): `ltx_video/models/autoencoders/vae_encode.py`
- [Latent upsampler](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/latent_upsampler.py): `ltx_video/models/autoencoders/latent_upsampler.py`

### Sampling and utilities

- [Rectified-flow scheduler](https://github.com/lightricks/ltx-video/blob/main/ltx_video/schedulers/rf.py): `ltx_video/schedulers/rf.py`
- [Prompt enhancement](https://github.com/lightricks/ltx-video/blob/main/ltx_video/utils/prompt_enhance_utils.py): `ltx_video/utils/prompt_enhance_utils.py`
- [Skip-layer strategy](https://github.com/lightricks/ltx-video/blob/main/ltx_video/utils/skip_layer_strategy.py): `ltx_video/utils/skip_layer_strategy.py`
- [Convolution factory](https://github.com/lightricks/ltx-video/blob/main/ltx_video/models/autoencoders/conv_nd_factory.py): `ltx_video/models/autoencoders/conv_nd_factory.py`
- [Config mapping](https://github.com/lightricks/ltx-video/blob/main/ltx_video/utils/diffusers_config_mapping.py): `ltx_video/utils/diffusers_config_mapping.py`
- [Tensor utilities](https://github.com/lightricks/ltx-video/blob/main/ltx_video/utils/torch_utils.py): `ltx_video/utils/torch_utils.py`

### Other components

- **User**
- **Prompt and media**
- **Generated video**

## Connections

- User → Prompt and media: provides (evidence: `README.md`)
- Prompt and media → Inference loader: submits (evidence: `README.md`)
- Model configs → Inference loader: configures (evidence: `ltx_video/inference.py`)
- Inference loader → Video pipeline: constructs (evidence: `ltx_video/inference.py`)
- Inference loader → Causal video VAE: loads (evidence: `ltx_video/inference.py`)
- Inference loader → 3D transformer: loads (evidence: `ltx_video/inference.py`)
- Inference loader → Rectified-flow scheduler: loads (evidence: `ltx_video/inference.py`)
- Inference loader → Latent upsampler: loads (evidence: `ltx_video/inference.py`)
- Inference loader → CRF compressor: uses (evidence: `ltx_video/inference.py`)
- Video pipeline → 3D transformer: denoises with (evidence: `ltx_video/pipelines/pipeline_ltx_video.py`)
- Video pipeline → Rectified-flow scheduler: steps with (evidence: `ltx_video/pipelines/pipeline_ltx_video.py`)
- Video pipeline → Causal video VAE: encodes and decodes (evidence: `ltx_video/pipelines/pipeline_ltx_video.py`)
- Video pipeline → VAE encoding: uses (evidence: `ltx_video/pipelines/pipeline_ltx_video.py`)
- Video pipeline → Patchifier: uses (evidence: `ltx_video/pipelines/pipeline_ltx_video.py`)
- Video pipeline → Latent upsampler: uses (evidence: `ltx_video/pipelines/pipeline_ltx_video.py`)
- Video pipeline → Prompt enhancement: uses (evidence: `ltx_video/pipelines/pipeline_ltx_video.py`)
- Video pipeline → Skip-layer strategy: uses (evidence: `ltx_video/pipelines/pipeline_ltx_video.py`)
- Video pipeline → Generated video: produces (evidence: `README.md`)
- 3D transformer → Attention blocks: applies (evidence: `ltx_video/models/transformers/transformer3d.py`)
- 3D transformer → Skip-layer strategy: uses (evidence: `ltx_video/models/transformers/transformer3d.py`)
- Causal video VAE → VAE layers: builds on (evidence: `ltx_video/models/autoencoders/causal_video_autoencoder.py`)
- Causal video VAE → Convolution factory: creates convolutions (evidence: `ltx_video/models/autoencoders/causal_video_autoencoder.py`)
- Video autoencoder → Convolution factory: creates convolutions (evidence: `ltx_video/models/autoencoders/video_autoencoder.py`)
- VAE layers → Convolution factory: creates convolutions (evidence: `ltx_video/models/autoencoders/vae.py`)
- Rectified-flow scheduler → Tensor utilities: uses (evidence: `ltx_video/schedulers/rf.py`)
- Causal video VAE → Config mapping: uses (evidence: `ltx_video/models/autoencoders/causal_video_autoencoder.py`)
- 3D transformer → Config mapping: uses (evidence: `ltx_video/models/transformers/transformer3d.py`)
