Repo of the Day
Tencent-Hunyuan/MovieRoll
Published: Dec 4, 2026
Open repository ↗Contribute to Tencent-Hunyuan/MovieRoll development by creating an account on GitHub.
Summary
MovieRoll is Tencent Hunyuan's Python framework for generating long-form video, structured as a supervised "Base" model plus a few-step "Distilled" model. The training and inference design targets the same problem: keeping video quality from degrading as generation continues, via window-wise teacher forcing, hierarchical KV caching, and cache recomputation. It ships released training and inference code, model weights on Hugging Face, and inference backends for SGLang Diffusion and vLLM-Omni.
What it is useful for
- Long text-to-video generation.
--video-lengthaccepts frames of the form16k+1: 241 frames (~10 s), 721 (~30 s), 1441 (~60 s). - Image-to-video.
--input-image first_frame.jpgis scaled and center-cropped to the video size and used as the first frame; the README recommends thedistilled/i2vcheckpoint for this. - Multi-event videos in one clip.
--prompt-list "..." "..." "..."plays several prompts in sequence, and--prompt-csv prompts.csvruns batches withindex,seed,prompt(orevent_1..event_N), and an optionalinput_imagecolumn. Example CSVs live inexample/. - Prompt rewriting. Skills under
agent/streaming-video-prompt-rewriteexpand a short idea into the long, detailed prompts MovieRoll handles best — a fixed or subject-tracking camera, sustained motion, one consistent setting across events.scripts/validate_prompt.pycan check rewritten prompts in English or Chinese. - Porting the method.
agent/movieroll-portis aimed at adapting MovieRoll's techniques to another codebase.
Documented limitations: consumer GPUs (e.g., RTX 4090/5090) are still an open TODO, CPU offload is not supported by the native inference entry point, Gradio support and streaming playback are not yet added, and inference efficiency is listed as work in progress.
How engineers can use it
Environment (from the repository root, per the README):
conda create -n movieroll python=3.12 -y && conda activate movieroll
pip install -r requirements.txt
pip install flash-attn --no-build-isolation
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"
FlashAttention-3 requires a Hopper (sm90) GPU such as an H100 — verify the kernel build supports your GPU first. A single-GPU run needs the full pipeline to fit in memory (a 96 GB GPU holds it); for eight GPUs use torchrun --nproc_per_node=8 with --sp-size 8 --shard-world 8. Note that --sp-size must divide both the GPU count and the model's 16 attention heads, and with FSDP --shard-world must divide the GPU count and be divisible by --sp-size.
Weights: accept the Hugging Face access conditions and run hf auth login, then download a checkpoint plus the shared VAE and text encoders:
MODEL=distilled/t2v
hf download yunyangge/MovieRoll --include "$MODEL/*" --local-dir ./ckpts/movieroll
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
Then run inference:
python generate_movieroll.py \
--model ckpts/movieroll/distilled/t2v --sp-size 1 \
--prompt "your long, detailed prompt" \
--seed 4890 --video-length 721 \
--output-dir ./outputs
Output lands in ./outputs/samples/default/rank0_sample_0.mp4. Base uses 50 steps with AnnealCFG; distilled checkpoints use 5 steps with no CFG. Model-specific defaults such as --context-noise come from the checkpoint's config.json.
For coding agents, agent/ holds task folders with SKILL.md files — movieroll-run for inference and training, movieroll-sglang and movieroll-vllm-omni for the backends. Training runs in four stages (Streaming SFT single-event → multi-event → ODE initialization → CuLT-DMD); exact configs and launch commands are in docs/TRAINING.md.