You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update LTX-2 Docs to Cover LTX-2.3 Models (#13337)
* Update LTX-2 docs to cover multimodal guidance and prompt enhancement
* Apply suggestions from code review
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
* Apply reviewer feedback
---------
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
LTX-2 is a DiT-based audio-video foundation model designed to generate synchronized video and audio within a single model. It brings together the core building blocks of modern video generation, with open weights and a focus on practical, local execution.
21
+
[LTX-2](https://hf.co/papers/2601.03233) is a DiT-based foundation model designed to generate synchronized video and audio within a single model. It brings together the core building blocks of modern video generation, with open weights and a focus on practical, local execution.
22
22
23
23
You can find all the original LTX-Video checkpoints under the [Lightricks](https://huggingface.co/Lightricks) organization.
24
24
@@ -293,6 +293,7 @@ import torch
293
293
from diffusers import LTX2ConditionPipeline
294
294
from diffusers.pipelines.ltx2.pipeline_ltx2_condition import LTX2VideoCondition
295
295
from diffusers.pipelines.ltx2.export_utils import encode_video
296
+
from diffusers.pipelines.ltx2.utils importDEFAULT_NEGATIVE_PROMPT
296
297
from diffusers.utils import load_image, load_video
297
298
298
299
device ="cuda"
@@ -315,19 +316,6 @@ prompt = (
315
316
"landscape is characterized by rugged terrain and a river visible in the distance. The scene captures the "
316
317
"solitude and beauty of a winter drive through a mountainous region."
317
318
)
318
-
negative_prompt = (
319
-
"blurry, out of focus, overexposed, underexposed, low contrast, washed out colors, excessive noise, "
Because the conditioning is done via latent frames, the 8 data space frames corresponding to the specified latent frame for an image condition will tend to be static.
368
356
357
+
## Multimodal Guidance
358
+
359
+
LTX-2.X pipelines support multimodal guidance. It is composed of three terms, all using a CFG-style update rule:
360
+
361
+
1. Classifier-Free Guidance (CFG): standard [CFG](https://huggingface.co/papers/2207.12598) where the perturbed ("weaker") output is generated using the negative prompt.
362
+
2. Spatio-Temporal Guidance (STG): [STG](https://huggingface.co/papers/2411.18664) moves away from a perturbed output created from short-cutting self-attention operations and substitutes in the attention values instead. The idea is that this creates sharper videos and better spatiotemporal consistency.
363
+
3. Modality Isolation Guidance: moves away from a perturbed output created from disabling cross-modality (audio-to-video and video-to-audio) cross attention. This guidance is more specific to [LTX-2.X](https://huggingface.co/papers/2601.03233) models, with the idea that this produces better consistency between the generated audio and video.
364
+
365
+
These are controlled by the `guidance_scale`, `stg_scale`, and `modality_scale` arguments and can be set separately for video and audio. Additionally, for STG the transformer block indices where self-attention is skipped needs to be specified via the `spatio_temporal_guidance_blocks` argument. The LTX-2.X pipelines also support [guidance rescaling](https://huggingface.co/papers/2305.08891) to help reduce over-exposure, which can be a problem when the guidance scales are set to high values.
366
+
367
+
```py
368
+
import torch
369
+
from diffusers import LTX2ImageToVideoPipeline
370
+
from diffusers.pipelines.ltx2.export_utils import encode_video
371
+
from diffusers.pipelines.ltx2.utils importDEFAULT_NEGATIVE_PROMPT
The LTX-2.X models are sensitive to prompting style. Refer to the [official prompting guide](https://ltx.io/model/model-blog/prompting-guide-for-ltx-2) for recommendations on how to write a good prompt. Using prompt enhancement, where the supplied prompts are enhanced using the pipeline's text encoder (by default a [Gemma 3](https://huggingface.co/google/gemma-3-12b-it-qat-q4_0-unquantized) model) given a system prompt, can also improve sample quality. The optional `processor` pipeline component needs to be present to use prompt enhancement. Enable prompt enhancement by supplying a `system_prompt` argument:
437
+
438
+
439
+
```py
440
+
import torch
441
+
from transformers import Gemma3Processor
442
+
from diffusers import LTX2Pipeline
443
+
from diffusers.pipelines.ltx2.export_utils import encode_video
444
+
from diffusers.pipelines.ltx2.utils importDEFAULT_NEGATIVE_PROMPT, T2V_DEFAULT_SYSTEM_PROMPT
0 commit comments