# LTX-2 DFRPipeline for Detail-Fidelity Rendering with Keyframes: A Complete Guide

> Explore the LTX-2 DFRPipeline for detail-fidelity rendering with keyframes. This guide details its three-stage diffusion process for temporally consistent, high-fidelity video generation.

- Repository: [Lightricks/LTX-2](https://github.com/Lightricks/LTX-2)
- Tags: how-to-guide
- Published: 2026-08-15

---

**The LTX-2 DFRPipeline implements a three-stage diffusion process—keyframe-slot anchoring, spatial LoRA detailing, and optional tiled temporal refinement—to generate temporally consistent, high-fidelity video from keyframe guidance.**

The **DFRPipeline** (Diffusion Fidelity Rendering) is LTX-2's specialized pipeline for detail-fidelity rendering with keyframes, designed to solve the classic video generation trade-off between spatial sharpness and temporal coherence. According to the Lightricks/LTX-2 source code, this pipeline orchestrates three distinct processing stages through a modular architecture defined in `ltx-pipelines`.

## Core Architecture: Three-Stage Rendering Flow

The pipeline's design centers on separating temporal anchoring from spatial refinement, allowing each to be optimized independently.

### Stage 1: Keyframe-Slot Base Generation

The foundation is a **keyframe-slot-capable SFT model** (Stable Diffusion Fine-tuned). This provides coarse, temporally-consistent latent representations where each input keyframe defines a **slot** that anchors surrounding frames.

- Slots act as hard temporal constraints, preventing drift in motion and appearance
- The SFT backbone generates the full video volume relative to these anchored positions
- Implemented in [`dfr_pipeline.py`](https://github.com/Lightricks/LTX-2/blob/main/dfr_pipeline.py) via the `_generate_slot_latents()` method (inferred from pipeline structure)

### Stage 2: Spatial Detail Enhancement

A **distilled LoRA (Low-Rank Adaptation)** enriches each frame with fine-grained spatial details:

- Injected on-the-fly during inference without model retraining
- Improves texture sharpness, color fidelity, and small-scale features
- Preserves temporal coherence because LoRA operates within the slot-structured latent space

### Stage 3: Optional Tiled Temporal Refinement

For demanding scenarios, the pipeline supports **tiled temporal passes** (commonly "temporal x2"):

| Parameter | Purpose | Typical Value |
|-----------|---------|-------------|
| `temporal_tiles` | Enable/disable tiled refinement | `True` for high fidelity |
| `tile_size` | Frames per temporal tile | 4-16 depending on memory |

This stage:
- Splits video into temporal tiles (sub-intervals)
- Runs additional diffusion passes per tile for motion continuity refinement
- Keeps memory usage bounded regardless of video length

## Module Structure and Source Files

The implementation spans two primary modules in `packages/ltx-pipelines/src/ltx_pipelines/`:

| Module | File Path | Responsibility |
|--------|-----------|--------------|
| [`dfr_pipeline.py`](https://github.com/Lightricks/LTX-2/blob/main/dfr_pipeline.py) | [`packages/ltx-pipelines/src/ltx_pipelines/dfr_pipeline.py`](https://github.com/Lightricks/LTX-2/blob/main/packages/ltx-pipelines/src/ltx_pipelines/dfr_pipeline.py) | Orchestrates three-stage flow, LoRA injection, tile dispatch |
| [`dfr_layout.py`](https://github.com/Lightricks/LTX-2/blob/main/dfr_layout.py) | [`packages/ltx-pipelines/src/ltx_pipelines/dfr_layout.py`](https://github.com/Lightricks/LTX-2/blob/main/packages/ltx-pipelines/src/ltx_pipelines/dfr_layout.py) | Defines canvas layout, keyframe grid, temporal tile ranges, latent stitching logic |

### DFRLayout: Spatial-Temporal Coordinate System

The `DFRLayout` class establishes the geometric framework:

- **Keyframe grid**: Row/column organization of anchor frames
- **Temporal tile ranges**: Frame indices assigned to each processing tile
- **Latent stitching**: Merges processed tiles into continuous video output

This separation allows custom layouts for non-linear temporal structures or region-of-interest processing.

## Practical Code Examples

### Basic Keyframe-Slot Rendering

```python
from ltx_pipelines import DFRPipeline

pipeline = DFRPipeline(
    base_model="ltx_core/sft_keyframe_slot",
    lora_path="path/to/distilled_lora.pt",
    temporal_tiles=False
)

video = pipeline(
    prompt="A bustling futuristic city at sunrise",
    keyframes=["frame0.png"],
    fps=30,
    duration=5
)
video.save("output_basic.mp4")

```

This minimal configuration uses single-keyframe anchoring with spatial LoRA but skips tiled refinement.

### High-Fidelity with Tiled Temporal Passes

```python
from ltx_pipelines import DFRPipeline

pipeline = DFRPipeline(
    base_model="ltx_core/sft_keyframe_slot",
    lora_path="path/to/distilled_lora.pt",
    temporal_tiles=True,
    tile_size=8
)

video = pipeline(
    prompt="A dragon soaring over misty mountains",
    keyframes=[
        "keyframe_start.png",
        "keyframe_mid.png",
        "keyframe_end.png"
    ],
    fps=24,
    duration=8
)
video.save("output_high_fidelity.mp4")

```

Multiple keyframes create a **slot sequence**, constraining motion at critical moments while the tiled passes refine inter-slot transitions.

### Custom Layout Configuration

```python
from ltx_pipelines.dfr_layout import DFRLayout
from ltx_pipelines import DFRPipeline

layout = DFRLayout(
    grid_rows=3,
    grid_cols=2,
    temporal_tile_range=(0, 16)
)

pipeline = DFRPipeline(
    layout=layout,
    base_model="ltx_core/sft_keyframe_slot",
    lora_path="path/to/distilled_lora.pt"
)

```

Direct `DFRLayout` instantiation enables precise control over the spatial-temporal processing grid.

## Performance and Memory Characteristics

| Configuration | VRAM Profile | Use Case |
|-------------|--------------|----------|
| `temporal_tiles=False` | Lowest | Short clips, rapid iteration |
| `temporal_tiles=True, tile_size=16` | Moderate | Standard high-fidelity output |
| `temporal_tiles=True, tile_size=4` | Higher | Maximum motion smoothness |

The tile-based architecture provides **O(tile_size)** memory complexity rather than O(sequence_length), enabling longer videos on consumer GPUs.

## Key Advantages of DFRPipeline for Detail-Fidelity Rendering

- **Temporal consistency by construction**: Slot-based anchoring prevents the flickering common in frame-wise diffusion
- **Modular quality scaling**: Add spatial LoRA and/or temporal tiles independently based on output requirements
- **Extensible architecture**: Swap SFT backbones, substitute custom LoRAs, or implement novel tiling strategies via the layout system

## Summary

- **LTX-2 DFRPipeline** implements detail-fidelity rendering through three coordinated stages: keyframe-slot generation, LoRA spatial enhancement, and optional tiled temporal refinement
- Core implementation resides in [`dfr_pipeline.py`](https://github.com/Lightricks/LTX-2/blob/main/dfr_pipeline.py) with layout logic in [`dfr_layout.py`](https://github.com/Lightricks/LTX-2/blob/main/dfr_layout.py) under `packages/ltx-pipelines/src/ltx_pipelines/`
- **Keyframe slots** provide hard temporal anchors that preserve motion continuity across arbitrary video lengths
- **Distilled LoRA injection** adds spatial detail without disrupting temporal structure
- **Tiled temporal passes** enable quality scaling with bounded memory consumption
- The **DFRLayout** abstraction supports custom spatial-temporal grids for specialized production workflows

## Frequently Asked Questions

### What makes DFRPipeline different from standard video diffusion pipelines?

Standard pipelines often struggle with either temporal flickering (when optimized for speed) or excessive memory consumption (when processing long sequences at high quality). **DFRPipeline solves this through explicit keyframe-slot architecture**: slots act as temporal anchor points that constrain the diffusion process, while the modular staging lets you add spatial detail (LoRA) and motion refinement (tiles) only where needed. This design is specific to the LTX-2 implementation in [`dfr_pipeline.py`](https://github.com/Lightricks/LTX-2/blob/main/dfr_pipeline.py).

### How many keyframes should I provide for optimal results?

**Two to four keyframes typically suffice** for most scenes. Single-keyframe configurations work for simple camera motions or static subjects. Multiple keyframes become essential for complex narratives with scene changes or character interactions—each keyframe creates a slot boundary that the pipeline preserves. The `DFRLayout` grid system (configurable via `grid_rows` and `grid_cols` in [`dfr_layout.py`](https://github.com/Lightricks/LTX-2/blob/main/dfr_layout.py)) determines how these slots spatially organize in the output.

### Can I use DFRPipeline without the LoRA component?

Yes. The `lora_path` parameter is optional; omitting it yields faster inference with reduced spatial detail. This configuration still benefits from keyframe-slot temporal consistency and optional tiled refinement. The trade-off is most visible in texture-rich scenes (fabric, foliage, skin) where the distilled LoRA provides noticeable fidelity gains.

### What temporal tile size should I choose?

**Start with 8-16 frames per tile** for 24-30 fps content. Smaller tiles (4-8 frames) improve motion continuity in fast action but increase processing time and VRAM usage. Larger tiles (16-32 frames) are more efficient but may miss fine motion corrections. The `tile_size` parameter directly controls this in `DFRPipeline` instantiation, and you can benchmark on short clips before full production renders.