Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,102 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
# FantasyPortrait: Enhancing Multi-Character Portrait Animation with Expression-Augmented Diffusion Transformers
|
| 5 |
+
|
| 6 |
+
[](https://fantasy-amap.github.io/fantasy-portrait/)
|
| 7 |
+
[](https://arxiv.org/abs/2507.12956)
|
| 8 |
+
[](https://huggingface.co/datasets/acvlab/FantasyPortrait)
|
| 9 |
+
[](https://huggingface.co/papers/2507.12956)
|
| 10 |
+
|
| 11 |
+
## 🔥 Latest News!!
|
| 12 |
+
* August 10, 2025: We released the inference code, model weights and datasets.
|
| 13 |
+
|
| 14 |
+
## Demo
|
| 15 |
+
For more interesting results, please visit our [website](https://fantasy-amap.github.io/fantasy-portrait/).
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
## Quickstart
|
| 19 |
+
### 🛠️Installation
|
| 20 |
+
|
| 21 |
+
Clone the repo:
|
| 22 |
+
|
| 23 |
+
```
|
| 24 |
+
git clone https://github.com/Fantasy-AMAP/fantasy-portrait.git
|
| 25 |
+
cd fantasy-portrait
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
Install dependencies:
|
| 29 |
+
```
|
| 30 |
+
apt-get install ffmpeg
|
| 31 |
+
# Ensure torch >= 2.0.0
|
| 32 |
+
pip install -r requirements.txt
|
| 33 |
+
# Note: flash attention must be installed
|
| 34 |
+
pip install flash_attn
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
### 📦Multi-Expr Dataset
|
| 38 |
+
We make public the first multi-portrait facial expression video dataset **Multi-Expr Dataset**, Please download it via the this [link](https://huggingface.co/datasets/acvlab/FantasyPortrait-Multi-Expr).
|
| 39 |
+
|
| 40 |
+
### 🧱Model Download
|
| 41 |
+
| Models | Download Link | Notes |
|
| 42 |
+
| --------------|-------------------------------------------------------------------------------|-------------------------------|
|
| 43 |
+
| Wan2.1-I2V-14B-720P | 🤗 [Huggingface](https://huggingface.co/Wan-AI/Wan2.1-I2V-14B-720P) 🤖 [ModelScope](https://www.modelscope.cn/models/Wan-AI/Wan2.1-I2V-14B-720P) | Base model
|
| 44 |
+
| FantasyPortrait | 🤗 [Huggingface](https://huggingface.co/acvlab/FantasyPortrait/) 🤖 [ModelScope](https://www.modelscope.cn/models/amap_cvlab/FantasyPortrait/) | Our emo condition weights
|
| 45 |
+
|
| 46 |
+
Download models using huggingface-cli:
|
| 47 |
+
``` sh
|
| 48 |
+
pip install "huggingface_hub[cli]"
|
| 49 |
+
huggingface-cli download Wan-AI/Wan2.1-I2V-14B-720P --local-dir ./models/Wan2.1-I2V-14B-720P
|
| 50 |
+
huggingface-cli download acvlab/FantasyPortrait --local-dir ./models
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
Download models using modelscope-cli:
|
| 54 |
+
``` sh
|
| 55 |
+
pip install modelscope
|
| 56 |
+
modelscope download Wan-AI/Wan2.1-I2V-14B-720P --local_dir ./models/Wan2.1-I2V-14B-720P
|
| 57 |
+
modelscope download amap_cvlab/FantasyPortrait --local_dir ./models
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
### 🔑 Single-Portrait Inference
|
| 61 |
+
``` sh
|
| 62 |
+
bash infer_single.sh
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
### 🔑 Multi-Portrait Inference
|
| 66 |
+
If you use input image and drive videos with multiple people, you can run as follows:
|
| 67 |
+
``` sh
|
| 68 |
+
bash infer_multi.sh
|
| 69 |
+
```
|
| 70 |
+
If you use input image with multiple people and different multiple single-human driven videos, you can run as follows:
|
| 71 |
+
```sh
|
| 72 |
+
bash infer_multi_diff.sh
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
### 📦Speed and VRAM Usage
|
| 76 |
+
We present a detailed table here. The model is tested on a single A100.
|
| 77 |
+
|
| 78 |
+
|`torch_dtype`|`num_persistent_param_in_dit`|Speed|Required VRAM|
|
| 79 |
+
|-|-|-|-|
|
| 80 |
+
|torch.bfloat16|None (unlimited)|15.5s/it|40G|
|
| 81 |
+
|torch.bfloat16|7*10**9 (7B)|32.8s/it|20G|
|
| 82 |
+
|torch.bfloat16|0|42.6s/it|5G|
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
## 🧩 Community Works
|
| 87 |
+
We ❤️ contributions from the open-source community! If your work has improved FantasyPortrait, please inform us.
|
| 88 |
+
Or you can directly e-mail [frank.jf@alibaba-inc.com](mailto://frank.jf@alibaba-inc.com). We are happy to reference your project for everyone's convenience.
|
| 89 |
+
|
| 90 |
+
## 🔗Citation
|
| 91 |
+
If you find this repository useful, please consider giving a star ⭐ and citation
|
| 92 |
+
```
|
| 93 |
+
@article{wang2025fantasyportrait,
|
| 94 |
+
title={FantasyPortrait: Enhancing Multi-Character Portrait Animation with Expression-Augmented Diffusion Transformers},
|
| 95 |
+
author={Wang, Qiang and Wang, Mengchao and Jiang, Fan and Fan, Yaqi and Qi, Yonggang and Xu, Mu},
|
| 96 |
+
journal={arXiv preprint arXiv:2507.12956},
|
| 97 |
+
year={2025}
|
| 98 |
+
}
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
## Acknowledgments
|
| 102 |
+
Thanks to [Wan2.1](https://github.com/Wan-Video/Wan2.1), [PD-FGC](https://github.com/Dorniwang/PD-FGC-inference) and [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio) for open-sourcing their models and code, which provided valuable references and support for this project. Their contributions to the open-source community are truly appreciated.
|