# HunyuanVideo: A Systematic Framework For Large Video Generative Models

Open video model HunyuanVideo matches leading closed-source video generators

Weijie Kong, Qi Tian, Zijian Zhang, Rox Min, Zuozhuo Dai, Jin Zhou and 46 more · arXiv · 2024-12-3

- **Problem** Leading video generation models are closed-source, so the public has lagged behind industry. Earlier open models were too small and too weak to close that gap.
- **Method** HunyuanVideo trains a 13B open Transformer diffusion model in a 3D VAE latent space.
- **Results** Professional evaluators rated HunyuanVideo above Runway Gen-3, Luma 1.6 and three top Chinese video models. It is the largest open-source video generative model.

## Why an open video model is the target

Diffusion-based image generation has spread quickly across open platforms, while open video generators have advanced far more slowly. The authors trace much of this stagnation to the absence of robust open foundation models, and note that the closed MovieGen model has no open release yet.

Their first finding concerns scaling: adding data, compute and parameters to a simple Transformer trained with Flow Matching was not efficient enough on its own. They therefore derived a scaling strategy that the report says cuts computational requirements by up to 5× while reaching the target performance. The report covers the whole pipeline, so its claims span data curation, architecture, training and infrastructure rather than a single component.

## Turning raw video into training sets

Raw videos are first cut into single-shot clips with PySceneDetect, and a Laplacian-based sharpness check picks a clear starting frame for each clip. Embeddings from an internal VideoCLIP model drive two steps: near-duplicate clips are removed by cosine distance, and k-means yields about 10K concept centroids used for resampling and balancing.

Filters score aesthetics and technical quality with Dover, clarity with a trained model, and motion speed from estimated optical flow, which removes static or slow clips. Scene boundaries come from combining PySceneDetect with TransNet v2, an internal OCR model removes clips with excessive text, and detectors remove watermarks, borders and logos.

Each stage raises the thresholds, producing 256p, 360p, 540p and 720p training sets, with each stage keeping between one half and one fifth of the previous stage's data. Across these stages the spatial resolution of the training clips grows from 256 × 256 × 65 to 720×1280 × 129.

The final fine-tuning set of about 1M samples is annotated by hand for visual aesthetics and for motion speed, action integrity and motion blur. The in-house captioner writes JSON captions with seven descriptive fields, covering the main content, dense description with camera movement, background, style, shot type, lighting and atmosphere, plus metadata tags.

Random dropout and recombination of these fields varies caption length and pattern, which the authors expect to improve generalization and reduce overfitting. A camera movement classifier with 14 classes adds its high-confidence predictions to the captions, so camera motion can be requested at generation time.

## Compressing video and images into latents

The 3D VAE maps a clip of shape (T+1)×3×H×W to latents of shape (T/c\_t+1)×C×(H/c\_s)×(W/c\_s), with c\_t = 4, c\_s = 8 and C = 16. \\\[(T+1)\\times 3\\times H\\times W\\;\\rightarrow\\;\\left(\\tfrac{T}{c\_t}+1\\right)\\times C\\times\\tfrac{H}{c\_s}\\times\\tfrac{W}{c\_s}\\\] CausalConv3D lets the same encoder handle single images and multi-frame videos, and the shorter token sequence that results is what allows the diffusion transformer to train on videos at their original resolution and frame rate.

Unlike most earlier work, the VAE is trained from scratch rather than initialized from a pretrained image VAE, and video and image data are mixed in a 4:1 ratio. Training follows a curriculum from low-resolution short clips to high-resolution long ones, and for high-motion content the frame sampling interval is drawn from 1 to 8.

Encoding long high-resolution clips on one GPU can run out of memory, so the input is split into overlapping spatial and temporal tiles that are encoded or decoded separately and blended by linear combination in the overlaps. Tiling at inference alone produced visible artifacts because training never used tiles, so an extra fine-tuning phase enables and disables tiling at random during training.

## VAE reconstruction against open VAEs

The comparison measures PSNR on ImageNet at 256×256 and on MCL-JCV at 33×360×640 against FLUX-VAE, OpenSora-1.2, CogVideoX-1.5 and Cosmos-VAE.

On MCL-JCV it scores 35.39, against 33.22 for CogVideoX-1.5, 32.76 for Cosmos-VAE and 30.15 for OpenSora-1.2. The authors also report visual gains on text, small faces and complex textures in their 256×256 examples.

The evidence covers one image set and one video set and measures reconstruction fidelity only, so generation quality is not measured in this table.

## A single Transformer for images and videos

The backbone applies Full Attention over all tokens, a choice the authors justify by its reported advantage over divided spatiotemporal attention, by its ability to serve images and videos in one setup, and by its fit with existing LLM acceleration tools. Images are treated as single-frame videos, so one patchify step serves both kinds of input.

The 3D latents are patchified with a 3D convolution into a one-dimensional token sequence whose length follows from the kernel size of k\_t × k\_h × k\_w.

Video and text tokens first pass through separate dual-stream blocks, so each modality keeps its own modulation, and are then concatenated so that single-stream blocks can fuse them. The 13B configuration uses 20 dual-stream blocks and 40 single-stream blocks, with model dimension 3072, FFN dimension 12288, 24 attention heads and head dimension 128.

Rotary Position Embedding is applied in every block and extended to three axes, with separate rotary frequencies computed for time, height and width. The query and key channels are split into segments of sizes d\_t, d\_h and d\_w, which are 16, 56 and 56 in the 13B configuration; each segment is rotated by its coordinate frequencies and the segments are concatenated.

## Using an MLLM as the text encoder

The text encoder is a pretrained multimodal LLM with a decoder-only structure, chosen over CLIP and T5-XXL for three stated reasons: visual instruction tuning aligns image and text features, its detailed description and reasoning are stronger, and system instructions can steer it in a zero-shot manner. The MLLM uses causal attention while T5-XXL attends bidirectionally, so a bidirectional token refiner is added on top of the MLLM features.

Several MLLMs are configured for different purposes, and the authors report superior performance over the conventional text encoder in each setting.

## Prompt rewriting and final fine-tuning

The prompt rewrite module accepts prompts in several languages, rewrites them into the same structure as training captions, and simplifies complex wording while keeping the user's intent. A self-revision step compares the original prompt with the rewrite to keep the final prompt accurate, and a Hunyuan-Large model is LoRA-tuned to do this rewriting more cheaply, using rewrite pairs collected with the training-free method.

The final fine-tuning stage uses four subsets chosen from the full data to raise dynamic quality and motion control, screened by automated filters and then reviewed manually.

## Scaling laws for images and video

For each compute budget, the envelope of lowest losses across sizes identifies the best model size, and the optimal parameter count and dataset size are then fitted as power laws in compute.

Taking training and inference cost into account, the authors set the model size to 13B. The token counts for image and video training follow from the two fitted curves, and each count applies only to the first training stage of its modality.

## Flow matching pre-training in stages

Training samples a time t from a logit-normal distribution, draws a Gaussian noise sample x\_0, and forms the training sample x\_t by linear interpolation between x\_0 and the latent x\_1. The network predicts the velocity u\_t = dx\_t/dt, and the loss is the squared norm of the difference between predicted and true velocity. \\\[\\mathcal{L}\_{\\text{generation}}=\\mathbb{E}\_{t,x\_0,x\_1}\\,\\lVert v\_t-u\_t\\rVert^{2}\\\] At inference a noise sample is integrated along the predicted velocity with a first-order Euler ODE solver to reach a latent.

Pre-training runs first on 256px and 512px images and then on joint image and video data from 256px up to 960px. Image stage 1 trains multi-aspect at 256px to avoid the text-image misalignment that cropping causes, and image stage 2 mixes scales to reach higher resolutions such as 512px. The image stages draw on pools of billions and hundreds of millions of image-text pairs, and the authors report that a well-pretrained image model speeds up video convergence.

## Time-step shifting for few-step sampling

With fewer steps, keeping spatial and temporal quality is harder for video than for images, and the authors build on the observation that the early time steps account for most of the change during generation. For step q out of Q, the time condition is t = 1 − q/Q, running from 1 down to 0, and a shifting factor s remaps t to a new time condition that conditions the model more on early steps when s \> 1.

Fewer steps need a larger shifting factor: s is 7 for 50 inference steps and is raised to 17 when there are fewer than 20 steps.

MovieGen uses a linear-quadratic scheduler for a similar purpose, and in the 10-step examples shown, the linear-quadratic scheduler gives worse visual quality than time-step shifting. This comparison is visual, based on sample videos at 10 steps, and the text gives no metric for it.

## Removing the second pass of classifier-free guidance

For a large video model at high resolution, generating the conditional and unconditional videos together is expensive, so the combined output is distilled into a single student model. The student shares the teacher's structure and hyperparameters, is initialized from the teacher's parameters, and is trained with guidance scales sampled from 1 to 8, so it takes a guidance scale as input.

The authors report about 1.9x inference acceleration from this distillation. The speed-up is given as a single figure, with no hardware or timing protocol attached.

## Training infrastructure and parallelism

HunyuanVideo is trained on AngelPTM, with GPU scheduling run on the Tencent Angel platform and inter-server traffic carried over the Tencent XingMai network. The parallel setup is what the authors call 5D parallelism, covering tensor, sequence and context parallelism together with data parallelism combined with ZeroCache. Tensor parallelism splits weight tensors across GPUs, sequence parallelism slices the sequence to share work on LayerNorm and Dropout, and context parallelism uses Ring Attention across sequence slices for long sequences.

ZeroCache reduces redundancy in parameters, gradients and optimizer states across data-parallel replicas.

FusedAttention accelerates attention, which becomes the main bottleneck as sequences grow, while recomputation and layer-wise activation offload to host memory reduce GPU memory use. An automatic fault tolerance mechanism detects errors and replaces unhealthy nodes, and the authors report 99.5% training stability. The 99.5% figure is described only as training stability, and the text does not define how it is computed.

## Human comparison with commercial video models

The main comparison is a professional human evaluation over more than 1,500 text prompts, with 60 people rating HunyuanVideo against Gen-3, Luma 1.6 and three top commercial models in China. The authors report that HunyuanVideo gives the highest overall satisfaction rates, with its strongest showing in motion dynamics. HunyuanVideo is said to outperform Runway Gen-3, Luma 1.6 and three top Chinese video generation models in this evaluation.

The text gives no per-model satisfaction rates, so the ranking rests on the authors' summary of the evaluation.

Showcases cover multi-subject prompts, high-detail clips, high-motion scenes and concept generalization, such as a scene set in a distant galaxy. Figure 1 is described as non-curated, while the later showcases are presented as examples, so they illustrate the claimed strengths and do not measure them.

## Image-to-video and video-to-audio extensions

HunyuanVideo-I2V keeps the text-to-video training and sets the reference image latent as the first frame with timestep 0, using token replacement. A semantic image injection module passes the image through the MLLM and concatenates the resulting tokens with the video latent tokens for full-attention calculation. For portrait video, the model is fine-tuned on two million portrait videos, filtered with face and body detectors that remove clips with more than five persons, and then unfreezes layers progressively.

The video-to-audio model is a flow-matching diffusion transformer whose audio is converted to a mel-spectrogram and encoded by a VAE. CLIP and T5 features are projected into the latent space and fused in triple-stream blocks for visual, audio and text, followed by single-stream blocks. A HiFiGAN vocoder converts the decoded mel-spectrogram back to a waveform, and the audio training data is described as millions of high-quality clips totalling 80,000 hours.

## Avatar animation on the backbone

To keep appearance fixed, the reference image is encoded by the 3D VAE with 16 channels, repeated over time and concatenated with the noisy latent along the channel dimension. In the audio-driven upper-body branch, whisper features enter through cross-attention layers, and expression latents enter through masked cross-attention with a residual update.

\\\[h\_i+\\mathrm{Attn}\_{exp}(h\_i,z\_{exp},z\_{exp})\\ast M\_{face}\\\] The mask M\_face limits where the expression update is applied, and the expression branch uses full-parameter tuning. The hybrid setting drives body motion with a skeletal pose sequence and facial expression with an implicit expression representation, with the two signals separable at inference.

The authors describe pose-driven, expression-driven and hybrid results with consistent identity, complex poses and generalization to anime and animal characters. These are demonstrations, and the text reports no metrics for them.

## Limitations

Progressive training from low to high resolution is left unexplored in scaling, so the scaling fits cover only the first-stage token counts. The text states that the scaling behaviour of progressive training is left to future work.

The commercial comparison rests on one human evaluation, and the text gives no per-dimension scores or satisfaction numbers. The VAE comparison covers one image set and one video set, measures reconstruction only, and compares VAEs with different compression factors. Time-step shifting is shown against one alternative scheduler at 10 steps, with visual examples only.

The image-to-video, video-to-audio and avatar sections are demonstrations without reported metrics in the text. The authors also say that recent open-source models still fall far behind closed-source systems such as Sora and MovieGen.

## Paper info

- **Authors**: Weijie Kong, Qi Tian, Zijian Zhang, Rox Min, Zuozhuo Dai, Jin Zhou, Jiangfeng Xiong, Xin Li, Bo Wu, Jianwei Zhang, Kathrina Wu, Qin Lin, Junkun Yuan, Yanxin Long, Aladdin Wang, Andong Wang, Changlin Li, Duojun Huang, Fang Yang, Hao Tan, Hongmei Wang, Jacob Song, Jiawang Bai, Jianbing Wu, Jinbao Xue, Joey Wang, Kai Wang, Mengyang Liu, Pengyu Li, Shuai Li, Weiyan Wang, Wenqing Yu, Xinchi Deng, Yang Li, Yi Chen, Yutao Cui, Yuanbo Peng, Zhentao Yu, Zhiyu He, Zhiyong Xu, Zixiang Zhou, Zunnan Xu, Yangyu Tao, Qinglin Lu, Songtao Liu, Dax Zhou, Hongfa Wang, Yong Yang, Di Wang, Yuhong Liu, Jie Jiang, Caesar Zhong
- **Venue**: arXiv · Preprint
- **First published**: 2024-12-3
- **Added**: 2026-11-12
- **Updated**: 2025-3-11
- **Version**: v6
- **arXiv**: 2412.03603
- **Category**: cs.CV
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/2412.03603v6) · [PDF ↗](https://arxiv.org/pdf/2412.03603v6)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Weijie Kong, Qi Tian, Zijian Zhang, Rox Min, Zuozhuo Dai, Jin Zhou, Jiangfeng Xiong, Xin Li, Bo Wu, Jianwei Zhang, Kathrina Wu, Qin Lin, Junkun Yuan, Yanxin Long, Aladdin Wang, Andong Wang, Changlin Li, Duojun Huang, Fang Yang, Hao Tan et al. (2024). HunyuanVideo: A Systematic Framework For Large Video Generative Models. arXiv:2412.03603v6. https://arxiv.org/abs/2412.03603v6

**BibTeX**

```
@misc{kong2024hunyuanvideo,
  title = {{HunyuanVideo: A Systematic Framework For Large Video Generative Models}},
  author = {Weijie Kong and Qi Tian and Zijian Zhang and Rox Min and Zuozhuo Dai and Jin Zhou and Jiangfeng Xiong and Xin Li and Bo Wu and Jianwei Zhang and Kathrina Wu and Qin Lin and Junkun Yuan and Yanxin Long and Aladdin Wang and Andong Wang and Changlin Li and Duojun Huang and Fang Yang and Hao Tan and Hongmei Wang and Jacob Song and Jiawang Bai and Jianbing Wu and Jinbao Xue and Joey Wang and Kai Wang and Mengyang Liu and Pengyu Li and Shuai Li and Weiyan Wang and Wenqing Yu and Xinchi Deng and Yang Li and Yi Chen and Yutao Cui and Yuanbo Peng and Zhentao Yu and Zhiyu He and Zhiyong Xu and Zixiang Zhou and Zunnan Xu and Yangyu Tao and Qinglin Lu and Songtao Liu and Dax Zhou and Hongfa Wang and Yong Yang and Di Wang and Yuhong Liu and Jie Jiang and Caesar Zhong},
  year = {2024},
  eprint = {2412.03603},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.03603v6}
}
```

## Related papers

- [MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model](https://refivu.com/en/papers/d7e4c79d-ac46-4e0f-aef6-34e570d43e2f-magicanimate-temporally-consistent-human-image-animation.md)
- [Transformers in Vision: A Survey](https://refivu.com/en/papers/5380a1d5-fae3-41ad-ab72-e650e9db12fe-transformers-in-vision-a-survey.md)
- [Demystifying Classifier-Free Guidance for Auto-Regressive Image Generation](https://refivu.com/en/papers/6287a67b-6c39-4e7c-895c-4860610f0055-demystifying-classifier-free-guidance-for-auto-regressive.md)
- [eDMD: Endpoint Distribution Matching for Few-Step Diffusion Distillation](https://refivu.com/en/papers/039e2f7f-dc99-4e6c-b431-a68221cbbfc2-edmd-endpoint-distribution-matching-for-few-step-diffusion.md)
- [$π\_0$: A Vision-Language-Action Flow Model for General Robot Control](https://refivu.com/en/papers/ad843b5e-218a-430e-9583-5911212661b1-0-a-vision-language-action-flow-model-for.md)

## Other paper commentary

- [IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models](https://refivu.com/en/papers/fd8adfd8-142d-4826-85e2-96e825c8d373-ip-adapter-text-compatible-image-prompt-adapter-for.md)
- [CogVideoX: Text-to-Video Diffusion Models with An Expert Transformer](https://refivu.com/en/papers/d337167e-74d3-423d-ae74-fbe584f8b441-cogvideox-text-to-video-diffusion-models-with-an.md)
- [Adversarial Examples: Attacks and Defenses for Deep Learning](https://refivu.com/en/papers/757e3533-c849-4349-8fbc-e8ea84c0b042-adversarial-examples-attacks-and-defenses-for-deep-learning.md)
- [Generative Adversarial Network in Medical Imaging: A Review](https://refivu.com/en/papers/52fe40f2-c64e-4c29-a115-6564288d69f5-generative-adversarial-network-in-medical-imaging-a-review.md)
- [AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks](https://refivu.com/en/papers/a0260608-3d36-436c-af24-a535c7e4e5ef-attngan-fine-grained-text-to-image-generation-with.md)
- [Stochastic Variational Inference](https://refivu.com/en/papers/36c9d62c-308d-476e-8657-7d699cf4658e-stochastic-variational-inference.md)
- [CSRNet: Dilated Convolutional Neural Networks for Understanding the Highly Congested Scenes](https://refivu.com/en/papers/991e4e38-4c34-4634-839b-1c56b435a442-csrnet-dilated-convolutional-neural-networks-for.md)
- [Robust and Communication-Efficient Federated Learning from Non-IID Data](https://refivu.com/en/papers/8cfbbb74-26ed-46b1-9bcb-908c177043d6-robust-and-communication-efficient-federated-learning-from.md)
- [Machine Learning for Combinatorial Optimization: a Methodological Tour d'Horizon](https://refivu.com/en/papers/9cbd91bd-7b47-473f-9fbe-9e1a438567b0-machine-learning-for-combinatorial-optimization-a.md)
- [Deep Learning on Graphs: A Survey](https://refivu.com/en/papers/2184aed4-7bc8-45a4-81a9-0ad60f8dc1c1-deep-learning-on-graphs-a-survey.md)
- [Metrics for Multi-Class Classification: an Overview](https://refivu.com/en/papers/78ca6b47-f74d-4a51-a805-f5f83bb18a77-metrics-for-multi-class-classification-an-overview.md)
- [Large Language Models for Software Engineering: A Systematic Literature Review](https://refivu.com/en/papers/fb65b16d-a211-4bae-b045-88b67d9525b7-large-language-models-for-software-engineering-a-systematic.md)

## Terms in this paper

- [Transformer](https://refivu.com/en/terms/48e8be2570bc-transformer)
- [classifier-free guidance](https://refivu.com/en/terms/7f72cec70f8e-classifier-free-guidance)
- [diffusion models](https://refivu.com/en/terms/39b044617fcd-diffusion-models)
- [Flow Matching](https://refivu.com/en/terms/866ec58102b7-flow-matching)
- [MLLM](https://refivu.com/en/terms/f69a44e03811-mllm)
- [Rotary Position Embedding (RoPE)](https://refivu.com/en/terms/a1d08fd81a8d-rotary-position-embedding-rope)
- [HunyuanVideo](https://refivu.com/en/terms/d8dbae4a4ebf-hunyuanvideo)
- [image-to-video](https://refivu.com/en/terms/9136db8b3561-image-to-video)
- [Multimodal Large Language Model](https://refivu.com/en/terms/ddac0ba94a6b-multimodal-large-language-model)
- [Neural scaling laws](https://refivu.com/en/terms/e9b33dbd1f1d-neural-scaling-laws)
- [Rotary Position Embedding](https://refivu.com/en/terms/b2cbefb0d7bb-rotary-position-embedding)
- [text-to-video](https://refivu.com/en/terms/4c4cb0d80769-text-to-video)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/bf878ce4-776a-4af5-9994-66e35572b481-hunyuanvideo-a-systematic-framework-for-large-video)
