Skip to content

Latest commit

 

History

History
114 lines (89 loc) · 5.31 KB

File metadata and controls

114 lines (89 loc) · 5.31 KB

English

FantasyPortrait:基于表情增强扩散变换器的多角色肖像动画生成

Home Page arXiv hf_dataset hf_model hf_paper ms_model ms_dataset

🔥 最新动态!!

  • 2025年8月14日:我们的工作被加入到ComfyUI-Wan ! 感谢 kijai 更新 👏!
  • 2025年8月12日:我们已发布推理代码、模型权重和数据集。

演示

更多有趣的结果,请访问我们的网站

单人示例 对比
动物 双人1
双人2 三人

快速开始

🛠️ 安装

克隆仓库:

git clone https://github.com/Fantasy-AMAP/fantasy-portrait.git
cd fantasy-portrait

安装依赖:

apt-get install ffmpeg
# 确保 torch >= 2.0.0
pip install -r requirements.txt
# 注意:必须安装 flash attention
pip install flash_attn

📦 Multi-Expr 数据集

我们公开了首个多人肖像面部表情视频数据集 Multi-Expr Dataset,请通过这个ModelScope或者Huggingface下载。

🧱 模型下载

模型 下载链接 说明
Wan2.1-I2V-14B-720P 🤗 Huggingface 🤖 ModelScope 基础模型
FantasyPortrait 🤗 Huggingface 🤖 ModelScope 我们的表情条件权重

使用 huggingface-cli 下载模型:

pip install "huggingface_hub[cli]"
huggingface-cli download Wan-AI/Wan2.1-I2V-14B-720P --local-dir ./models/Wan2.1-I2V-14B-720P
huggingface-cli download acvlab/FantasyPortrait --local-dir ./models

使用 modelscope-cli 下载模型:

pip install modelscope
modelscope download Wan-AI/Wan2.1-I2V-14B-720P --local_dir ./models/Wan2.1-I2V-14B-720P
modelscope download amap_cvlab/FantasyPortrait  --local_dir ./models

🔑 单人肖像推理

bash infer_single.sh

🔑 多人肖像推理

如果你使用多人的输入图像和多人的驱动视频,您可以运行如下脚本:

bash infer_multi.sh

如果您使用多人输入图像和不同的多个单人驱动的视频,您可以运行如下脚本:

bash infer_multi_diff.sh

📦 速度与显存占用

我们在此提供详细表格。模型在单张A100上进行测试。

torch_dtype num_persistent_param_in_dit 速度 所需显存
torch.bfloat16 None (无限制) 15.5秒/迭代 40G
torch.bfloat16 7*10**9 (7B) 32.8秒/迭代 20G
torch.bfloat16 0 42.6秒/迭代 5G

🧩 社区贡献

我们 ❤️ 来自开源社区的贡献!如果您的工作改进了 FantasyPortrait,请告知我们。 您也可以直接发送邮件至 frank.jf@alibaba-inc.com。我们很乐意引用您的项目,方便大家使用。

🔗 引用

如果本仓库对您有帮助,请考虑给我们一个 star ⭐ 并引用以下论文:

@article{wang2025fantasyportrait,
  title={FantasyPortrait: Enhancing Multi-Character Portrait Animation with Expression-Augmented Diffusion Transformers},
  author={Wang, Qiang and Wang, Mengchao and Jiang, Fan and Fan, Yaqi and Qi, Yonggang and Xu, Mu},
  journal={arXiv preprint arXiv:2507.12956},
  year={2025}
}

致谢

感谢 Wan2.1PD-FGCDiffSynth-Studio 开源他们的模型和代码,为本项目提供了宝贵的参考和支持。我们非常感谢他们对开源社区的贡献。

Star 历史

Star History Chart