# LongLive

> NVIDIA's training and inference stack for real-time interactive long video generation

- Category: Multimodal Generation / Video World Models
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/NVlabs/LongLive
- Website: https://nvlabs.github.io/LongLive/LongLive2/
- Canonical page: https://ai-tldr.dev/tools/longlive/
- Updated: 2026-10-07

## In short

LongLive is NVIDIA Research's open-source stack for long, interactive video generation. It sits in the Video World Models category of the Multimodal Generation tools and is open-source, written in Python and licensed Apache-2.0. To get started: clone the main branch only.

## Overview

LongLive is NVIDIA Research's open-source stack for long, interactive video generation. LongLive 1.0 (ICLR 2026) established the interactive half: it accepts a sequence of user prompts and keeps generating video in real time as they arrive, using attention sink, KV-recache and streaming long tuning to hold quality across a long rollout. That version now lives on the repository's `v1.0` branch with its training and inference code and the LongLive-1.3B weights.

LongLive 2.0 is the infrastructure release: an NVFP4 parallel stack covering both training and inference. On the training side it adds balanced sequence parallelism for text-to-video and image-to-video autoregressive teacher-forcing, multi-shot (or single-shot) training, and NVFP4 or BF16 for both AR training and few-step distillation. On the inference side it does W4A4 NVFP4 with an NVFP4 KV cache, TorchAO FP8 W8A8 post-training quantisation from the BF16 checkpoint, multi-shot attention sink, sequence-parallel inference and async decoding.

The repository is maintained as working infrastructure rather than a frozen paper drop: FP8 inference landed in July 2026, the NVFP4 inference path was tuned with fused Triton RoPE/adaLN kernels, reduced KV-cache synchronisation, in-place quantised KV-cache updates and pinned VAE transfers for an 18.6% throughput gain, and I2V teacher-forcing and DMD distillation for Wan2.2-TI2V-5B arrived alongside. It carries a full documentation site covering installation, NVFP4 setup, training modes, inference and data organisation, plus a companion retrieval-augmented project, LongLive-RAG. In October 2026 the repository also gained Long-WAM, a world-action model for robot control built on a LongLive 2.0 Robot video model, with evaluation scripts for LIBERO, RoboTwin 2.0, DOMINO and RoboCasa and real-robot interfaces for YAM, Franka and Unitree G1.

## What it does

- Real-time interactive generation from a stream of user prompts (LongLive 1.0: attention sink, KV-recache, streaming long tuning)
- NVFP4 W4A4 inference with an NVFP4 KV cache, plus TorchAO FP8 W8A8 post-training quantisation from the BF16 checkpoint
- Balanced sequence parallelism for T2V and I2V autoregressive teacher-forcing training, single- or multi-shot
- NVFP4 or BF16 for both AR training and few-step distillation
- Multi-shot attention sink, sequence-parallel inference and async decoding
- Full documentation site covering installation, NVFP4 setup, training modes, inference and training-data layout

## Getting started

Installation, NVFP4 setup, training and data layout are documented on the project's docs site; the commands below are the repository's own quick start. The validated FP8 stack is Python 3.10, PyTorch 2.8.0+cu128 and TorchAO 0.13.0 on H100, and compute capability 8.9 or newer is required.

1. Clone the main branch only

   A default clone fetches the demopage branch too, which carries large assets.

```bash
git clone --single-branch --branch main --depth 1 https://github.com/NVlabs/LongLive.git
```

2. Generate a clip in BF16

   The quick-start pipeline loads a merged checkpoint, prepares the prompt inputs and writes an mp4. place_vae_for_streaming is a no-op unless inference.streaming_vae is true and inference.vae_device is set, so toggling streaming decode is a yaml change rather than a code change.

```python
import torch
from omegaconf import OmegaConf

from pipeline import CausalDiffusionInferencePipeline
from utils.config import normalize_config
from utils.inference_utils import (
    load_generator_checkpoint,
    place_vae_for_streaming,
    prepare_single_prompt_inputs,
    save_video,
)

prompt = "A compact silver robot walks through a clean robotics lab."
config = normalize_config(OmegaConf.load("configs/inference.yaml"))
device = torch.device("cuda")

torch.set_grad_enabled(False)
pipe = CausalDiffusionInferencePipeline(config, device=device)
load_generator_checkpoint(pipe.generator, "LongLive-2.0-5B/model_bf16.pt")
pipe = pipe.to(device=device, dtype=torch.bfloat16)
place_vae_for_streaming(pipe, config)
pipe.generator.model.eval().requires_grad_(False)

noise, prompts = prepare_single_prompt_inputs(config, prompt, device)
video = pipe.inference(noise=noise, text_prompts=prompts)
save_video(video[0], "videos/quickstart/sample.mp4", fps=24)
```

3. Run FP8 post-training quantised inference

   Download model_bf16.pt from the Efficient-Large-Model/LongLive-2.0-5B repository on Hugging Face and point checkpoints.generator_ckpt at it. This loads the BF16 generator, applies TorchAO row-wise dynamic FP8 W8A8 PTQ and enables the torch.compile path; its max-autotune warm-up takes several minutes, so exclude warm-up samples when measuring steady-state throughput.

```bash
python inference.py --config_path configs/fp8/inference_fp8.yaml
```

4. Switch to NVFP4

   Point checkpoints.generator_ckpt in the NVFP4 config at the downloaded checkpoint and set model_quant_use_transformer_engine to match the backend: true for a TransformerEngine checkpoint (model_te.pt), false for a FourOverSix checkpoint (model_4o6.pt).

```text
configs/nvfp4/inference_nvfp4.yaml
```

## When to use it

- Generate minute-scale video that responds to prompts as they arrive, rather than rendering a fixed clip
- Train or distil your own autoregressive video model with sequence parallelism and low-precision support already wired in
- Cut inference cost on a 5B video model with NVFP4 W4A4 or FP8 W8A8 quantisation
- Study a worked implementation of attention sink, KV-recache and few-step distillation for long video

## Version history

- 2026-10-07: Long-WAM landed in the repository's Long-WAM folder: a world-action model for robots that pretrains a LongLive 2.0 Robot video model, then adapts it to predict actions using up to 19.2 seconds of visual history. Code and checkpoints are Apache 2.0.
- 2026-05-18 2.0: LongLive 2.0 shipped as an NVFP4 parallel infrastructure for long video generation, covering AR training, DMD distillation and inference; NVIDIA reported 2.15× faster training, 1.84× faster inference and 45.7 FPS for the 5B model.
