[来源关键摘录] HunyuanVideo 官方代码仓库,公开模型推理实现、FP8 量化支持与社区生态集成接口。
[正文前段节选] Skip to content
Navigation Menu
Appearance settings
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
Repository navigation
HunyuanVideo
NotificationsYou must be signed in to change notification settings
Fork1.4k (1.4k)
Star12.8k (12.8k)You must be signed in to star a repository
HunyuanVideo: A Systematic Framework For Large Video Generation Model
aivideo.hunyuan.tencent.com
diffusion-modelsdiffusion-transformervideo-generation
Custom properties
142 watching
Report repository
BranchesTags
Open more actions menu
Latest commit
Folders and files
Last commit message
Last commit date
README_zh.md
gradio_server.py
requirements.txt
sample_video.py
View all files
Repository files navigation
👋 Join our WeChat and Discord
This repo contains PyTorch model definitions, pre-trained weights and inference/sampling code for our paper exploring HunyuanVideo. You can find more visualizations on our project page.
Nov 21, 2025: 🎉 We release the HunyuanVideo-1.5, a highly efficient and powerful new foundation model.
May 28, 2025: 💃 We release the HunyuanVideo-Avatar, an audio-driven human animation model based on HunyuanVideo.
May 09, 2025: 🙆 We release the HunyuanCustom, a multimodal-driven architecture for customized video generation based on HunyuanVideo.
Mar 06, 2025: 🌅 We release the HunyuanVideo-I2V, an image-to-video model based on HunyuanVideo.
Jan 13, 2025: 📈 We release the Penguin Video Benchmark.
Dec 18, 2024: 🏃♂️ We release the FP8 model weights of HunyuanVideo to save more GPU memory.
Dec 17, 2024: 🤗 HunyuanVideo has been integrated into Diffusers.
Dec 7, 2024: 🚀 We release the parallel inference code for HunyuanVideo powered by xDiT.
Dec 3, 2024: 👋 We release the inference code and model weights of HunyuanVideo. Download.
🧩 Community Contributions
If you develop/use HunyuanVideo in your projects, welcome to let us know.
ComfyUI-Kijai (FP8 Inference, V2V and IP2V Generation): ComfyUI-HunyuanVideoWrapper by Kijai
ComfyUI-Native (Native Support): ComfyUI-HunyuanVideo by ComfyUI Official
FastVideo (Consistency Distilled Model and Sliding Tile Attention): FastVideo and Sliding Tile Attention by Hao AI Lab
HunyuanVideo-gguf (GGUF Version and Quantization): HunyuanVideo-gguf by city96
Enhance-A-Video (Better Generated Video for Free): Enhance-A-Video by NUS-HPC-AI-Lab
TeaCache (Cache-based Accelerate): TeaCache by Feng Liu
HunyuanVideoGP (GPU Poor version): HunyuanVideoGP by DeepBeepMeep
RIFLEx (Video Length Extrapolation): RIFLEx by Tsinghua University
HunyuanVideo Keyframe Control Lora: hunyuan-video-keyframe-control-lora by dashtoon
Sparse-VideoGen (Accelerate Video Generation with High Pixel-level Fidelity): Sparse-VideoGen by University of California, Berkeley
FramePack (Packing Input Frame Context in Next-Frame Prediction Models for Video Generation): FramePack by Lvmin Zhang
Jenga (Training-Free Efficient Video Generation via Dynamic Token Carving): Jenga by DV Lab
DCM (Dual-Expert Consistency Model for Efficient and High-Quality Video Generation): DCM by Vchitect
NaviCache (Offline Calibration-free Cache-based Accelerate): NaviCache by Zhejiang University
📑 Open-source Plan
HunyuanVideo (Text-to-Video Model)
Multi-gpus Sequence Parallel inference (Faster inference speed on more gpus)
Web Demo (Gradio)
FP8 Quantified weight
Penguin Video Benchmark
HunyuanVideo (Image-to-Video Model)
HunyuanVideo Overall Architecture
🎉 HunyuanVideo Key Features
Unified Image and Video Generative Architecture
MLLM Text Encoder
Prompt Rewrite
📈 Comparisons
📜 Requirements
🛠️ Dependencies and Installation
Installation Guide for Linux
🧱 Download Pretrained Models
🔑 Single-gpu Inference
Using Command Line
Run a Gradio Server
More Configurations
🚀 Parallel Inference on Multiple GPUs by xDiT
🚀 FP8 Inference
Acknowledgements
Star History
We present HunyuanVideo, a novel open-source video foundation model that exhibits performance in video generation that is comparable to, if not superior to, leading closed-source models. In order to train HunyuanVideo model, we adopt several key technologies for model learning, including data curation, image-video joint model training, and an efficient infrastructure designed to facilitate large-scale model training and inference. Additionally, through an effective strategy for scaling model architecture and dataset, we successfully trained a video generative model with over 13 billion parameters, making it the largest among all open-source models.
We conducted extensive experiments and implemented a series of targeted designs to ensure high visual quality, motion diversity, text-video alignment, and generation stability. According to professional human evaluation results, HunyuanVideo outperforms previous state-of-the-art models, including Runway Gen-3, Luma 1.6, and 3 top-performing Chinese video generative models. By releasing the code and weights of the foundation model and its applications, we aim to bridge the gap between closed-source and open-source video foundation models. This initiative will empower everyone in the community to experiment with their ideas, fostering a more dynamic and vibrant video generation ecosystem.
HunyuanVideo is trained on a spatial-temporally
compressed latent space, which is compressed through a Causal 3D VAE. Text prompts are encoded
using a large language model, and used as the conditions. Taking Gaussian noise and the conditions as
input, our generative model produces an output latent, which is then decoded to images or videos through
the 3D VAE decoder.
HunyuanVideo introduces the Transformer design and employs a Full Attention mechanism for unified image and video generation.
Specifically, we use a "Dual-stream to Single-stream" hybrid model design for video generation. In the dual-stream phase, video and text
tokens are processed independently through multiple Transformer blocks, enabling each modality to learn its own appropriate modulation mechanisms without interference. In the single-stream phase, we concatenate the video and text
tokens and feed them into subsequent Transformer blocks for effective multimodal information fusion.
This design captures complex interactions between visual and semantic information, enhancing
overall model performance.
Some previous text-to-video models typically use pre-trained CLIP and T5-XXL as text encoders where CLIP uses Transformer Encoder and T5 uses an Encoder-Decoder structure. In contrast, we utilize a pre-trained Multimodal Large Language Model (MLLM) with a Decoder-Only structure as our text encoder, which has the following advantages: (i) Compared with T5, MLLM after visual instruction finetuning has better image-text alignment in the feature space, which alleviates the difficulty of the instruction following in diffusion models; (ii)
Compared with CLIP, MLLM has demonstrated superior ability in image detail description
and complex reasoning; (iii) MLLM can play as a zero-shot learner by following system instructions prepended to user prompts, helping text features pay more attention to key information. In addition, MLLM is based on causal attention while T5-XXL utilizes bidirectional attention that produces better text guidance for diffusion models. Therefore, we introduce an extra bidirectional token refiner to enhance text features.
HunyuanVideo trains a 3D VAE with CausalConv3D to compress pixel-space videos and images into a compact latent space. We set the compression ratios of video length, space, and channel to 4, 8, and 16 respectively. This can significantly reduce the number of tokens for the subsequent diffusion transformer model, allowing us to train videos at the original resolution and frame rate.
[...内容已截断,完整版请查看原文或 Wayback 快照]