fantasy-talking

Fantasy-AMAPApache-2.0更新放缓

基于扩散模型生成逼真说话人像视频,通过连贯运动合成让口型与头部动作自然同步,适合做数字人播报和虚拟主播。

[ACM MM 2025] FantasyTalking: Realistic Talking Portrait Generation via Coherent Motion Synthesis

暂无版本1,629star127fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/Fantasy-AMAP/fantasy-talking.git
cd fantasy-talking
pip install -r requirements.txt
huggingface-cli download Wan-AI/Wan2.1-I2V-14B-720P --local-dir ./models/Wan2.1-I2V-14B-720P
huggingface-cli download facebook/wav2vec2-base-960h --local-dir ./models/wav2vec2-base-960h
huggingface-cli download acvlab/FantasyTalking fantasytalking_model.ckpt --local-dir ./models
python infer.py --image_path ./assets/images/woman.png --audio_path ./assets/audios/woman.wav
硬件要求按 README 说明

README 在单张 A100 上测试(512x512、81 帧):不限制常驻参数约需 40G 显存,限制 7B 约需 20G,限制为 0 约需 5G;未说明 CPU 运行或其他 GPU 型号。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 Wan2.1 的音频驱动说话人像视频生成工具,输入一张图和一段音频即可生成口型同步、动作自然的说话视频

基于扩散模型生成逼真说话人像视频,通过连贯运动合成让口型与头部动作自然同步,适合做数字人播报和虚拟主播。

核心能力

  • 以 Wan2.1-I2V-14B-720P 为底座做音频条件微调
  • 用 Wav2Vec 音频编码器提取语音特征驱动口型
  • 通过 prompt 控制人物动作与说话风格
  • 支持调节 prompt 与 audio cfg 提升口型一致性
  • 提供 Gradio 本地演示与 ComfyUI-Wan 集成

容易踩的坑

需先手动下载 Wan2.1 底座、Wav2Vec 和 FantasyTalking 三份权重到 ./models 才能推理;要求 torch >= 2.0.0,flash_attn 为可选加速项;显存不足时需通过 num_persistent_param_in_dit 限制常驻参数,但会明显变慢。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    中文阅读

    FantasyTalking: Realistic Talking Portrait Generation via Coherent Motion Synthesis

    Home Page arXiv hf_paper

    🔥 Latest News!!

    • July 7, 2025: Released a user guide to solve the common issues reported by recent researchers and the community.
    • July 5, 2025: Our work is accepted by ACM MM 2025!
    • April 29, 2025: Our work is merged to ComfyUI-Wan ! Thank kijai for the update 👏!
    • April 28, 2025: We released the inference code and model weights for audio conditions.

    Quickstart

    🛠️Installation

    Clone the repo:

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

    Install dependencies:

    # Ensure torch >= 2.0.0
    pip install -r requirements.txt
    # Optional to install flash_attn to accelerate attention computation
    pip install flash_attn
    

    🧱Model Download

    ModelsDownload LinkNotes
    Wan2.1-I2V-14B-720P🤗 Huggingface 🤖 ModelScopeBase model
    Wav2Vec🤗 Huggingface 🤖 ModelScopeAudio encoder
    FantasyTalking model🤗 Huggingface 🤖 ModelScopeOur audio condition weights

    Download models using 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 facebook/wav2vec2-base-960h --local-dir ./models/wav2vec2-base-960h
    huggingface-cli download acvlab/FantasyTalking fantasytalking_model.ckpt --local-dir ./models
    

    Download models using modelscope-cli:

    pip install modelscope
    modelscope download Wan-AI/Wan2.1-I2V-14B-720P --local_dir ./models/Wan2.1-I2V-14B-720P
    modelscope download AI-ModelScope/wav2vec2-base-960h --local_dir ./models/wav2vec2-base-960h
    modelscope download amap_cvlab/FantasyTalking   fantasytalking_model.ckpt  --local_dir ./models
    

    🔑 Inference

    python infer.py  --image_path ./assets/images/woman.png --audio_path ./assets/audios/woman.wav
    

    You can control the character's behavior through the prompt. The recommended range for prompt and audio cfg is [3-7]. You can increase the audio cfg to achieve more consistent lip-sync.

    python infer.py  --image_path ./assets/images/woman.png --audio_path ./assets/audios/woman.wav --prompt "The person is speaking enthusiastically, with their hands continuously waving." --prompt_cfg_scale 5.0 --audio_cfg_scale 5.0
    

    We present a detailed table here. The model is tested on a single A100.(512x512, 81 frames).

    torch_dtypenum_persistent_param_in_ditSpeedRequired VRAM
    torch.bfloat16None (unlimited)15.5s/it40G
    torch.bfloat167*10**9 (7B)32.8s/it20G
    torch.bfloat16042.6s/it5G

    Gradio Demo

    We construct an online demo in Huggingface. For the local gradio demo, you can run:

    pip install gradio spaces
    python app.py
    

    🧩 Community Works

    We ❤️ contributions from the open-source community! If your work has improved FantasyTalking, please inform us. Or you can directly e-mail [email protected]. We are happy to reference your project for everyone's convenience.

    🔗Citation

    If you find this repository useful, please consider giving a star ⭐ and citation

    @article{wang2025fantasytalking,
       title={FantasyTalking: Realistic Talking Portrait Generation via Coherent Motion Synthesis},
       author={Wang, Mengchao and Wang, Qiang and Jiang, Fan and Fan, Yaqi and Zhang, Yunpeng and Qi, Yonggang and Zhao, Kun and Xu, Mu},
       journal={arXiv preprint arXiv:2504.04842},
       year={2025}
     }
    

    Acknowledgments

    Thanks to Wan2.1, HunyuanVideo, and 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.

    Star History

    Star History Chart