Wan2.2 I2V A14B Diffusers

提供商Wan-AI
分类image-to-video
许可证apache-2.0
下载量4.9K
星标7

简介

Wan2.2 I2V A14B 是一款由 Wan-AI 推出的高性能图生视频模型,现已集成至 Diffusers 库,极大降低了开发者的部署门槛。该模型主打对图像细节的精准还原与动态演化的自然度,能够将静态图片转化为高质量的短视频。对于习惯使用 Hugging Face 生态的开发者来说,无需复杂的环境配置即可快速上手。相比于传统的视频生成工具,它在动作流畅度和指令遵循上表现出色,非常适合用于短视频创作、电商产品动态展示及 AI 动画原型开发。

核心亮点

  • 支持 Diffusers 框架,部署与调用极其便捷
  • 精准还原原图细节,视频动态过渡自然
  • Apache-2.0 协议,对商业应用非常友好
  • 适用于电商动态图及高质量 AI 视频创作

使用方法

安装依赖
# 安装 Hugging Face transformers
pip install transformers torch
SDK 使用
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("Wan-AI/Wan2.2-I2V-A14B-Diffusers")
tokenizer = AutoTokenizer.from_pretrained("Wan-AI/Wan2.2-I2V-A14B-Diffusers")

Hugging Face 下载

我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 huggingface_hub:

操作指引
pip install -U huggingface_hub

命令行下载

下载完整模型库

下载完整模型库
huggingface-cli download Wan-AI/Wan2.2-I2V-A14B-Diffusers

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download Wan-AI/Wan2.2-I2V-A14B-Diffusers config.json --local-dir ./dir

更多命令行下载选项,可参见官方文档

SDK 下载

SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('Wan-AI/Wan2.2-I2V-A14B-Diffusers')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://huggingface.co/Wan-AI/Wan2.2-I2V-A14B-Diffusers

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Wan-AI/Wan2.2-I2V-A14B-Diffusers

模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。

PyTorch / Transformers 使用

安装 Transformers

安装 Transformers
pip install -U transformers torch

模型加载和推理

模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('Wan-AI/Wan2.2-I2V-A14B-Diffusers')
tokenizer = AutoTokenizer.from_pretrained('Wan-AI/Wan2.2-I2V-A14B-Diffusers')

模型下载

我们推荐使用命令行或者 ModelScope SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 ModelScope:

操作指引
pip install modelscope

命令行下载

下载完整模型库

下载完整模型库
modelscope download --model Wan-AI/Wan2.2-I2V-A14B-Diffusers

下载单个文件到指定本地文件夹(以下载 README.md 到当前路径下 dir 目录为例)

下载单个文件到指定本地文件夹(以下载 README.md 到当前路径下 dir 目录为例)
modelscope download --model Wan-AI/Wan2.2-I2V-A14B-Diffusers README.md --local_dir ./dir

更多更丰富的命令行下载选项,可参见具体文档

SDK 下载

SDK 下载
# 模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('Wan-AI/Wan2.2-I2V-A14B-Diffusers')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://www.modelscope.cn/Wan-AI/Wan2.2-I2V-A14B-Diffusers.git

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/Wan-AI/Wan2.2-I2V-A14B-Diffusers.git

ModelScope 模型页直接下载模型文件;无需将模型文件放在本站服务器。

Notebook 快速开发

下载并安装 ModelScope library

下载并安装 ModelScope library
pip install "modelscope[audio,cv,nlp,multi-modal,science]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

模型加载和推理

模型加载和推理
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

p = pipeline('text-generation', 'Wan-AI/Wan2.2-I2V-A14B-Diffusers')

完整文档

来源: HuggingFace

---
license: apache-2.0
language:

  • en

  • zh

pipeline_tag: image-to-video
---

Wan2.2

<p align="center">
<img src="assets/logo.png" width="400"/>
<p>

<p align="center">
💜 <a href="https://wan.video"><b>Wan</b></a> &nbsp&nbsp | &nbsp&nbsp 🖥️ <a href="https://github.com/Wan-Video/Wan2.2">GitHub</a> &nbsp&nbsp | &nbsp&nbsp🤗 <a href="https://huggingface.co/Wan-AI/">Hugging Face</a>&nbsp&nbsp | &nbsp&nbsp🤖 <a href="https://modelscope.cn/organization/Wan-AI">ModelScope</a>&nbsp&nbsp | &nbsp&nbsp 📑 <a href="https://arxiv.org/abs/2503.20314">Technical Report</a> &nbsp&nbsp | &nbsp&nbsp 📑 <a href="https://wan.video/welcome?spm=a2ty_o02.30011076.0.0.6c9ee41eCcluqg">Blog</a> &nbsp&nbsp | &nbsp&nbsp💬 <a href="https://gw.alicdn.com/imgextra/i2/O1CN01tqjWFi1ByuyehkTSB_!!6000000000015-0-tps-611-1279.jpg">WeChat Group</a>&nbsp&nbsp | &nbsp&nbsp 📖 <a href="https://discord.gg/AKNgpMK4Yj">Discord</a>&nbsp&nbsp
<br>

-----

Wan: Open and Advanced Large-Scale Video Generative Models <be>

We are excited to introduce Wan2.2, a major upgrade to our foundational video models. With Wan2.2, we have focused on incorporating the following innovations:

  • 👍 Effective MoE Architecture: Wan2.2 introduces a Mixture-of-Experts (MoE) architecture into video diffusion models. By separating the denoising process cross timesteps with specialized powerful expert models, this enlarges the overall model capacity while maintaining the same computational cost.
  • 👍 Cinematic-level Aesthetics: Wan2.2 incorporates meticulously curated aesthetic data, complete with detailed labels for lighting, composition, contrast, color tone, and more. This allows for more precise and controllable cinematic style generation, facilitating the creation of videos with customizable aesthetic preferences.
  • 👍 Complex Motion Generation: Compared to Wan2.1, Wan2.2 is trained on a significantly larger data, with +65.6% more images and +83.2% more videos. This expansion notably enhances the model's generalization across multiple dimensions such as motions, semantics, and aesthetics, achieving TOP performance among all open-sourced and closed-sourced models.
  • 👍 Efficient High-Definition Hybrid TI2V: Wan2.2 open-sources a 5B model built with our advanced Wan2.2-VAE that achieves a compression ratio of 16×16×4. This model supports both text-to-video and image-to-video generation at 720P resolution with 24fps and can also run on consumer-grade graphics cards like 4090. It is one of the fastest 720P@24fps models currently available, capable of serving both the industrial and academic sectors simultaneously.

This repository also includes our I2V-A14B model, designed for image-to-video generation, supporting both 480P and 720P resolutions. Built with a Mixture-of-Experts (MoE) architecture, it achieves more stable video synthesis with reduced unrealistic camera movements and offers enhanced support for diverse stylized scenes.

Video Demos

<div align="center">
<video width="80%" controls>
<source src="https://cloud.video.taobao.com/vod/NnCd0fC-1eckDUuVBMz43oD_U6mTsPpBwga3wdnAkXA.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>

🔥 Latest News!!

  • Jul 28, 2025: 👋 Wan2.1 has been integrated into ComfyUI (CN | EN). Enjoy!
  • Jul 28, 2025: 👋 Wan2.2's T2V, I2V and TI2V have been integrated into Diffusers (T2V-A14B | I2V-A14B | TI2V-5B). Feel free to give it a try!
  • Jul 28, 2025: 👋 We've released the inference code and model weights of Wan2.2.

Community Works

If your research or project builds upon Wan2.1 or Wan2.2, we welcome you to share it with us so we can highlight it for the broader community.

📑 Todo List

  • Wan2.2 Text-to-Video
- [x] Multi-GPU Inference code of the A14B and 14B models - [x] Checkpoints of the A14B and 14B models - [x] ComfyUI integration - [x] Diffusers integration
  • Wan2.2 Image-to-Video
- [x] Multi-GPU Inference code of the A14B model - [x] Checkpoints of the A14B model - [x] ComfyUI integration - [x] Diffusers integration
  • Wan2.2 Text-Image-to-Video
- [x] Multi-GPU Inference code of the 5B model - [x] Checkpoints of the 5B model - [x] ComfyUI integration - [x] Diffusers integration

Run Wan2.2

#### Installation
Clone the repo:

sh
git clone https://github.com/Wan-Video/Wan2.2.git
cd Wan2.2

Install dependencies:

sh
# Ensure torch >= 2.4.0

If the installation of flash_attn fails, try installing the other packages first and install flash_attn last


pip install -r requirements.txt

#### Model Download

| Models | Download Links | Description |
|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------|-------------|
| T2V-A14B | 🤗 Huggingface 🤖 ModelScope | Text-to-Video MoE model, supports 480P & 720P |
| I2V-A14B | 🤗 Huggingface 🤖 ModelScope | Image-to-Video MoE model, supports 480P & 720P |
| TI2V-5B | 🤗 Huggingface 🤖 ModelScope | High-compression VAE, T2V+I2V, supports 720P |

> 💡Note:
> The TI2V-5B model supports 720P video generation at 24 FPS.

Download models using huggingface-cli:
`` sh
pip install "huggingface_hub[cli]"
huggingface-cli download Wan-AI/Wan2.2-I2V-A14B --local-dir ./Wan2.2-I2V-A14B

code
Download models using modelscope-cli:
sh
pip install modelscope
modelscope download Wan-AI/Wan2.2-I2V-A14B --local_dir ./Wan2.2-I2V-A14B
code
#### Run Image-to-Video Generation

This repository supports the Wan2.2-I2V-A14B` Image-to-Video model and can simultaneously support video generation at 480P and 720P resolutions.

  • Single-GPU inference
sh python generate.py --task i2v-A14B --size 1280*720 --ckpt_dir ./Wan2.2-I2V-A14B --offload_model True --convert_model_dtype --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."
code
> This command can run on a GPU with at least 80GB VRAM.

> 💡For the Image-to-Video task, the size` parameter represents the area of the generated video, with the aspect ratio following that of the original input image.

  • Multi-GPU inference using FSDP + DeepSpeed Ulysses
sh torchrun --nproc_per_node=8 generate.py --task i2v-A14B --size 1280*720 --ckpt_dir ./Wan2.2-I2V-A14B --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 b