Tencent-Hunyuan/MovieRoll
Python
Captured source
source ↗Tencent-Hunyuan/MovieRoll
Language: Python
License: NOASSERTION
Stars: 21
Forks: 0
Open issues: 0
Created: 2026-11-11T07:35:36Z
Pushed: 2026-11-17T06:18:56Z
Default branch: main
Fork: no
Archived: no
README: [中文文档](./README_CN.md)
🎬 Video Demo
https://github.com/user-attachments/assets/2d4287cd-ae78-4870-8cd9-fec0edb21ecf
🔥 News!
- [2026.11.16] 🚀 Day-0 support for [SGLang Diffusion](./sglang_movieroll/README.md) and [vLLM-Omni](./vllm_omni_movieroll/README.md).
- [2026.11.16] 🎉 We release the MovieRoll code!
✅ TODO List
- [x] Release training and inference code
- [x] Release model weights
- [x] Support SGLang and vLLM-Omni
- [ ] Support consumer GPUs (e.g., RTX 4090 and RTX 5090)
- [ ] Add Gradio support
- [ ] Improve inference efficiency
- [ ] Add streaming playback: decode and output video while generation continues
🔎 Overview
MovieRoll is a systematic framework for rolling out long-form videos, from a supervised Base model to a few-step Distilled model. Its training and inference designs work together to reduce degradation as generation continues.
- Base to Distilled: window-wise teacher forcing trains MovieRoll-Base; ODE initialization and cumulative long tuning (CuLT-DMD) produce MovieRoll-Distilled.
- Long-rollout generation: joint window denoising, hierarchical KV caching, and cache recomputation support continuous generation; AnnealCFG reduces guidance toward the clean endpoint in the Base model.
- Single- and multi-event control: generate from one prompt or an ordered sequence of event prompts, with released text-to-video and image-to-video checkpoints.
🎁 Model Zoo
| Model | Supported tasks | Resolution (H × W) | Denoising steps | Guidance | Download | |---|---|---|---|---|---| | MovieRoll-Base | T2V (text-to-video), I2V (image-to-video) | 480p (arbitrary aspect ratios) | 50 | AnnealCFG | base | | MovieRoll-Distilled (T2V) | T2V (text-to-video) | 480 × 864 / 864 × 480 | 5 | No CFG | distilled/t2v | | MovieRoll-Distilled (I2V) | I2V (image-to-video) | 480 × 864 / 864 × 480 | 5 | No CFG | distilled/i2v |
🛠️ Environment
Runtime and GPU setup
The commands below use Python 3.12, CUDA-enabled PyTorch, and the installed FlashAttention kernels. FlashAttention-3 is built from its hopper/ directory and needs a Hopper (sm90) GPU such as the H100; check that the kernel build supports your GPU before starting a long run. Run all commands from the repository root after installation.
| Launch configuration | Purpose | Settings | |---|---|---| | 8 GPUs | Optional multi-GPU inference | torchrun --nproc_per_node=8; --sp-size 8, --shard-world 8 | | 1 GPU | Default Quick Start | python; --sp-size 1; the full pipeline must fit on the GPU (a 96 GB GPU holds it) |
For other GPU counts, --sp-size must divide both the GPU count and the model's 16 attention heads; with FSDP, --shard-world must also divide the GPU count and be divisible by --sp-size. Single-process inference does not use FSDP. The examples use BF16 transformer computation.
CPU offload is not supported by this native inference entry point yet. Support is planned to enable inference on consumer GPUs.
git clone https://github.com/Tencent-Hunyuan/MovieRoll.git && cd MovieRoll conda create -n movieroll python=3.12 -y && conda activate movieroll pip install -r requirements.txt pip install flash-attn --no-build-isolation # FlashAttention-2, required # FlashAttention-3, also required (Hopper / sm90 GPUs) git clone --recursive https://github.com/Dao-AILab/flash-attention.git cd flash-attention/hopper && pip install . --no-build-isolation && cd ../.. python -c "import flash_attn, flash_attn_interface" # prints nothing when both are installed
⚡ Optional: SageAttention
SageAttention speeds up sampling by about 1.4×. Install it from the commit below (the v2.2.0 release has a kernel bug), then add --attention-backend sage to an inference command. The videos are very close to the default FlashAttention-3 output, but not bit-identical.
git clone https://github.com/thu-ml/SageAttention.git && cd SageAttention git checkout d1a57a5 && pip install . --no-build-isolation && cd ..
🧱 Download Checkpoints
The MovieRoll weights are hosted at yunyangge/MovieRoll. Accept the repository's access conditions and authenticate with hf auth login before downloading gated weights.
1. Download one MovieRoll checkpoint. Set MODEL to base, distilled/t2v, or distilled/i2v:
MODEL=distilled/t2v hf download yunyangge/MovieRoll --include "$MODEL/*" --local-dir ./ckpts/movieroll
2. Download the shared VAE and text encoders. These are required for inference with any of the three checkpoints:
hf download tencent/HunyuanVideo-1.5 --include 'vae/*' --local-dir ./ckpts hf download Qwen/Qwen2.5-VL-7B-Instruct --local-dir ./ckpts/text_encoder/llm hf download google/byt5-small --local-dir ./ckpts/text_encoder/byt5-small modelscope download --model AI-ModelScope/Glyph-SDXL-v2 --local_dir ./ckpts/text_encoder/Glyph-SDXL-v2
ckpts/ ├── vae/ ├── text_encoder/ │ ├── llm/ │ ├── byt5-small/ │ └── Glyph-SDXL-v2/ └── movieroll/ ├── base/ # download if selected └── distilled/ ├── t2v/ # download if selected └── i2v/ # download if selected
Each selected model directory contains config.json and model.safetensors. Its config supplies model-specific sampling defaults; reference copies are in [movieroll/configs/models/](./movieroll/configs/models). Training initialization weights are covered in the [training guide](./docs/TRAINING.md).
🤖 For Agents
You can ask a coding agent with access to this repository to read the relevant task folder under [agent/](./agent). Start with its SKILL.md (or SKILL_CN.md for Chinese), follow the linked references as needed, and carry out your task using those instructions.
| Task | Skill folder | |---|---| | Rewrite text-to-video, image-to-video, or multi-event prompts | [streaming-video-prompt-rewrite](./agent/streaming-video-prompt-rewrite) | | Run inference or any training stage | [movieroll-run](./agent/movieroll-run) | | Port MovieRoll's methods to another codebase |...
Excerpt shown — open the source for the full document.