ComfyUI-LTXVideo

repository·master·Indexed 26 days ago

https://github.com/lightricks/comfyui-ltxvideo

A collection of custom nodes for ComfyUI that enables advanced video generation using the LTX-2 model. Features include HDR output (ARRI LogC3), lip-syncing (Lipdub), generative upscaling via Pixel Spatial Upscaler, and text-to-audio generation. It includes the LTXVLoopingSampler for creating long, high-resolution videos through temporal and spatial tiling, as well as support for LTX-2.3 and LTX-2.0 workflows.

Tokens
3.2K
Snippets
2
Records
20
Agent score
38%

What's inside ComfyUI-LTXVideo

  1. Overview of LTXVLoopingSampler

    master

    The LTXVLoopingSampler is a unified ComfyUI node designed for generating long, high-resolution videos. It addresses memory and computational constraints by utilizing temporal and spatial tiling, breaking video generation into manageable chunks. This allows for the creation of videos that exceed the capacity of a single model run.

    Key capabilities include:

    • Autoregressive long video generation.
    • Keyframe support.
    • Guidance using IC-LoRA video modalities.
    • Normalization.
    • 'Long memory' via conditioning on negative positional encodings.
  2. Use LTXVLoopingSampler for video generation

    master

    LTXVLoopingSampler is a specialized sampler designed to overcome temporal length and spatial resolution limits in video generation. It uses temporal tiling (overlapping time segments) to create long videos and spatial tiling (overlapping spatial regions) to create high-resolution frames. Each tile is processed independently and then seamlessly blended.

    Required Parameters

    • model: The diffusion model.
    • vae: VAE for encoding/decoding.
    • noise: Noise generator.
    • sampler: Sampling algorithm (e.g., Euler, DPM++).
    • sigmas: Noise schedule.
    • guider: Conditioning guider (must be STGGuiderAdvanced).
    • latents: Input latent tensor. Non-empty latents enable partial denoising.

    Key Features

    • Temporal Tiling: Processes overlapping time segments for long videos.
    • Spatial Tiling: Divides frames into regions for high-resolution output.
    • Memory Efficient: Processes one spatial tile at a time.
    • Seamless Blending: Uses weighted blending for transitions.
    • Advanced Seeding: Configurable per-tile seeding for reproducibility.
  3. Install LTX-2.3 LoRAs

    master

    Download desired LoRA models to COMFYUI_ROOT_FOLDER/models/loras.

    Required for two-stage pipelines (except DistilledPipeline and ICLoraPipeline):

    • ltx-2.3-22b-distilled-lora-384-1.1.safetensors

    Available IC-LoRAs and Control LoRAs include:

    • Union Control: ltx-2.3-22b-ic-lora-union-control-ref0.5.safetensors
    • Motion Track: ltx-2.3-22b-ic-lora-motion-track-control-ref0.5.safetensors
    • HDR: ltx-2.3-22b-ic-lora-hdr-0.9.safetensors
    • Lipdub: ltx-2.3-22b-ic-lora-lipdub-0.9.safetensors
    • Detailer: ltx-2-19b-ic-lora-detailer.safetensors
    • Pose Control: ltx-2-19b-ic-lora-pose-control.safetensors
    • Camera Controls (Dolly In/Left/Out/Right, Jib Up/Down, Static): ltx-2-19b-lora-camera-control-...
    • Specialized: instant-shave, colorization, cross-eyed, day-to-night, deblur, decompression, in-outpainting, water-simulation, ingredients, and pixel-spatial-upscaler (x2/x4).
  4. Use Pixel Spatial Upscaler IC-LoRA for Generative Upscaling

    master

    The Pixel Spatial Upscaler IC-LoRAs are designed for creative upscaling by synthesizing fine detail rather than simple interpolation.

    Usage Details

    • Variants: Available in (moderate upscaling) and (large resolution jumps) versions.
    • Workflow Pattern: It is recommended to use a Draft-then-upscale approach: generate at a low base resolution (e.g., ~280p) to establish composition/motion, then apply the upscaler.
    • Fidelity Control: You can tune how closely the output follows the reference by adjusting LoRA strength, guidance, and step count. Higher values allow for more creative detail synthesis.
  5. Use Guided Generation with IC-LoRA

    master

    Advanced control can be achieved using guiding latents, typically used with IC-LoRA.

    Setup

    • Connect guiding latents to optional_guiding_latents.
    • Adjust guiding_strength (0.0-1.0) to control the influence of the latents.
    • Use guiding_start_step and guiding_end_step (0-1000) to define when the guidance is applied during the denoising process.
  6. Use Negative Index Latents for long-term coherence

    master

    optional_negative_index_latents allows temporal chunks to attend to additional latents (derived from another image or video) using negative positional embeddings. This helps maintain global coherence and reduces drift in long sequences.

    Usage

    • Connect reference latent(s) to the optional_negative_index_latents input.
    • Applications: Maintaining consistent subjects/styles, referencing a global template, or enforcing scene/character coherence.
  7. Install ComfyUI-LTXVideo via ComfyUI Manager

    master

    To install the LTXVideo custom nodes, use the ComfyUI Manager within your ComfyUI interface:

    1. Open ComfyUI.
    2. Click the Manager button (or press Ctrl+M).
    3. Select Install Custom Nodes.
    4. Search for LTXVideo.
    5. Click Install.
    6. Wait for the installation to complete and then Restart ComfyUI.

    Once installed, nodes will be available under the LTXVideo category in the node menu. Required models are automatically downloaded upon first use.

  8. Download required LTX-2.3 models

    master

    To use ComfyUI-LTXVideo, you must download specific model checkpoints and place them in the correct ComfyUI directory structure.

    LTX-2.3 Model Checkpoints Download one of the following to COMFYUI_ROOT_FOLDER/models/checkpoints:

    • ltx-2.3-22b-dev.safetensors
    • ltx-2.3-22b-distilled-1.1.safetensors

    Upscalers Required for two-stage pipeline implementations. Download to COMFYUI_ROOT_FOLDER/models/latent_upscale_models:

    • Spatial Upscaler: ltx-2.3-spatial-upscaler-x2-1.1.safetensors or ltx-2.3-spatial-upscaler-x1.5-1.0.safetensors
    • Temporal Upscaler: ltx-2.3-temporal-upscaler-x2-1.0.safetensors
  9. Use MultiPromptProvider for dynamic temporal prompts

    master

    The MultiPromptProvider is a utility node designed to work with LTXVLoopingSampler. It allows you to create evolving narratives by providing a sequence of prompts that change across temporal tiles during video generation.

    Usage Rules:

    • Format: Provide prompts as a single string separated by the pipe character (|), for example: "prompt1|prompt2|prompt3".
    • Mapping: Each prompt in the sequence is applied to one temporal_tile in the LTXVLoopingSampler.
    • Underflow: If you provide fewer prompts than there are temporal tiles, the last prompt in your list will be repeated for all remaining tiles.
    • Overflow: If you provide more prompts than there are temporal tiles, any extra prompts at the end of the string will be ignored.
    "prompt1|prompt2|prompt3"
  10. Optimize for Low VRAM

    master

    If you are working with limited VRAM, use the following methods to ensure generation fits within 32 GB VRAM:

    1. Model Loader Nodes: Use the specialized model loader nodes from low_vram_loaders.py to ensure correct execution order and model offloading.
    2. Reserve VRAM Parameter: Use the --reserve-vram flag when starting ComfyUI to reserve a specific amount of memory in GB.
    python -m main --reserve-vram 5
  11. Explore LTX-2 Example Workflows

    master

    Example workflows are provided for various LTX-2.3 and LTX-2.0 tasks. You can find them locally in your ComfyUI installation at: ComfyUI/custom_nodes/ComfyUI-LTXVideo/example_workflows/

    LTX-2.3 Workflows include:

    • Text/image to video (Single Stage or Two Stage with upsampling)
    • Union IC-LoRA (Depth + Human Pose + Edges)
    • IC-LoRA Motion Tracking
    • IC-LoRA HDR
    • IC-LoRA Lipdub (Two Stage)
    • IC-LoRA Pixel Spatial Upscaling
    • Text to audio (Single Stage)

    LTX-2.0 Workflows include:

    • Text to video (Full or Distilled)
    • Image to video (Full or Distilled)
    • Video to video detailer
    • IC-LoRA (All conditions)