💜 Wan | 🖥️ GitHub | 🤗 Hugging Face | 🤖 ModelScope | 📑 论文(即将发布) | 📑 博客 | 💬 微信群 | 📖 Discord
本仓库为您呈现Wan2.1——一套全面开放的视频基础模型套件,旨在突破视频生成的边界。Wan2.1具备以下核心特性:
本仓库包含我们的I2V-14B模型,该模型能够生成480P视频,在生成速度和视频质量方面均具优势。
克隆仓库:
git clone https://github.com/Wan-Video/Wan2.1.git
cd Wan2.1安装依赖项:
# Ensure torch >= 2.4.0
pip install -r requirements.txt| 模型名称 | 下载链接 | 说明 |
|---|---|---|
| T2V-14B | 🤗 Huggingface 🤖 ModelScope | 支持480P和720P |
| I2V-14B-720P | 🤗 Huggingface 🤖 ModelScope | 支持720P |
| I2V-14B-480P | 🤗 Huggingface 🤖 ModelScope | 支持480P |
| T2V-1.3B | 🤗 Huggingface 🤖 ModelScope | 支持480P |
💡注意:1.3B模型能够生成720P分辨率的视频。但由于该分辨率下的训练数据有限,生成结果通常不如480P稳定。为获得最佳性能,建议使用480P分辨率。
使用🤗 huggingface-cli下载模型:
pip install "huggingface_hub[cli]"
huggingface-cli download Wan-AI/Wan2.1-I2V-14B-480P --local-dir ./Wan2.1-I2V-14B-480P使用🤖 modelscope-cli下载模型:
pip install modelscope
modelscope download Wan-AI/Wan2.1-I2V-14B-480P --local_dir ./Wan2.1-I2V-14B-480P与文本转视频类似,图像转视频也分为包含提示词扩展步骤和不包含提示词扩展步骤的流程。具体参数及对应设置如下:
| Task | 分辨率 | 模型 | |
|---|---|---|---|
| 480P | 720P | ||
| i2v-14B | ❌ | ✔️ | Wan2.1-I2V-14B-720P |
| i2v-14B | ✔️ | ❌ | Wan2.1-T2V-14B-480P |
python generate.py --task i2v-14B --size 832*480 --ckpt_dir ./Wan2.1-I2V-14B-480P --image examples/i2v_input.JPG --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside."💡在图像转视频任务中,
size参数代表生成视频的面积,其宽高比将遵循原始输入图像的宽高比。
pip install "xfuser>=0.4.1"
torchrun --nproc_per_node=8 generate.py --task i2v-14B --size 832*480 --ckpt_dir ./Wan2.1-I2V-14B-480P --image examples/i2v_input.JPG --dit_fsdp --t5_fsdp --ulysses_size 8 --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside."使用 Qwen/Qwen2.5-VL-7B-Instruct 运行本地提示词扩展:
python generate.py --task i2v-14B --size 832*480 --ckpt_dir ./Wan2.1-I2V-14B-480P --image examples/i2v_input.JPG --use_prompt_extend --prompt_extend_model Qwen/Qwen2.5-VL-7B-Instruct --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside."使用 dashscope 通过远程提示扩展运行:
DASH_API_KEY=your_key python generate.py --task i2v-14B --size 832*480 --ckpt_dir ./Wan2.1-I2V-14B-480P --image examples/i2v_input.JPG --use_prompt_extend --prompt_extend_method 'dashscope' --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside."cd gradio
# if one only uses 480P model in gradio
DASH_API_KEY=your_key python i2v_14B_singleGPU.py --prompt_extend_method 'dashscope' --ckpt_dir_480p ./Wan2.1-I2V-14B-480P
# if one only uses 720P model in gradio
DASH_API_KEY=your_key python i2v_14B_singleGPU.py --prompt_extend_method 'dashscope' --ckpt_dir_720p ./Wan2.1-I2V-14B-720P
# if one uses both 480P and 720P models in gradio
DASH_API_KEY=your_key python i2v_14B_singleGPU.py --prompt_extend_method 'dashscope' --ckpt_dir_480p ./Wan2.1-I2V-14B-480P --ckpt_dir_720p ./Wan2.1-I2V-14B-720P我们对图像转视频模型的性能进行了全面的人工评估,结果如下表所示。结果清晰表明,Wan2.1 在性能上优于所有闭源和开源模型。
我们在下表中测试了不同 Wan2.1 模型在不同GPU上的计算效率。结果以 总时间(秒)/ 峰值GPU内存(GB) 的格式呈现。
本表格中呈现的测试参数设置如下: (1) 对于8块GPU上的1.3B模型,设置
--ring_size 8和--ulysses_size 1; (2) 对于单块GPU上的14B模型,使用--offload_model True; (3) 对于单块4090 GPU上的1.3B模型,设置--offload_model True --t5_cpu; (4) 所有测试均未应用提示扩展,即未启用--use_prompt_extend。
Wan2.1 基于主流的扩散 transformer 范式设计,通过一系列创新实现了生成能力的显著提升。这些创新包括我们全新的时空变分自编码器(VAE)、可扩展的训练策略、大规模数据构建以及自动化评估指标。这些贡献共同增强了模型的性能和多功能性。
我们提出了一种新颖的3D因果VAE架构,称为Wan-VAE,专门为视频生成设计。通过结合多种策略,我们改进了时空压缩,减少了内存使用,并确保了时间因果性。与其他开源VAE相比,Wan-VAE 在性能效率方面展现出显著优势。此外,我们的Wan-VAE 能够对无限长度的1080P视频进行编码和解码,而不会丢失历史时间信息,这使其特别适合视频生成任务。
Wan2.1 在主流扩散Transformer范式内采用流匹配(Flow Matching)框架进行设计。我们模型的架构使用T5编码器对多语言文本输入进行编码,每个Transformer块中的交叉注意力将文本嵌入到模型结构中。此外,我们采用一个包含线性层和SiLU层的MLP来处理输入的时间嵌入,并分别预测六个调制参数。该MLP在所有Transformer块之间共享,每个块学习一组不同的偏置。我们的实验结果表明,在相同的参数规模下,这种方法能带来显著的性能提升。
| 模型 | 维度 | 输入维度 | 输出维度 | 前馈网络维度 | 频率维度 | 头数 | 层数 |
|---|---|---|---|---|---|---|---|
| 1.3B | 1536 | 16 | 16 | 8960 | 256 | 12 | 30 |
| 14B | 5120 | 16 | 16 | 13824 | 256 | 40 | 40 |
我们精心筛选并去重了一个包含海量图像和视频数据的候选数据集。在数据整理过程中,我们设计了四步数据清洗流程,重点关注基础维度、视觉质量和运动质量。通过强大的数据处理 pipeline,我们能够轻松获取高质量、多样化和大规模的图像及视频训练集。

我们将Wan2.1 与领先的开源和闭源模型进行了性能比较。使用我们精心设计的1035个内部提示,我们在14个主要维度和26个子维度上进行了测试。然后,我们通过对每个维度的分数进行加权计算来得出总分,权重来源于匹配过程中的人类偏好。详细结果如下表所示。这些结果表明,我们的模型在性能上优于所有开源和闭源模型。

如果您觉得我们的工作对您有所帮助,请引用我们的成果。
@article{wan2.1,
title = {Wan: Open and Advanced Large-Scale Video Generative Models},
author = {Wan Team},
journal = {},
year = {2025}
}本仓库中的模型采用 Apache 2.0 许可协议授权。对于您生成的内容,我们不主张任何权利,您可自由使用,但需确保您的使用符合本许可协议的规定。您对模型的使用承担全部责任,不得分享任何违反适用法律、对个人或群体造成伤害、传播用于伤害目的的个人信息、散布虚假信息或针对弱势群体的内容。有关限制的完整列表及您的权利详情,请参阅许可协议全文。
感谢 SD3、Qwen、umt5-xxl、diffusers 和 HuggingFace 仓库的贡献者们所开展的开放研究工作。