### Run Local Gradio Demo for FantasyTalking Source: https://github.com/fantasy-amap/fantasy-talking/blob/main/README.md Instructions to install necessary Python packages ('gradio', 'spaces') and run the local Gradio demonstration application for FantasyTalking. ```Bash pip install gradio spaces python app.py ``` -------------------------------- ### Clone and Install FantasyTalking Dependencies Source: https://github.com/fantasy-amap/fantasy-talking/blob/main/README.md Instructions to clone the FantasyTalking repository and install its required Python dependencies. It also mentions an optional step to install 'flash_attn' for accelerated attention computation. ```Bash git clone https://github.com/Fantasy-AMAP/fantasy-talking.git cd fantasy-talking ``` ```Bash # Ensure torch >= 2.0.0 pip install -r requirements.txt # Optional to install flash_attn to accelerate attention computation pip install flash_attn ``` -------------------------------- ### Download FantasyTalking Models using Huggingface CLI Source: https://github.com/fantasy-amap/fantasy-talking/blob/main/README.md Commands to install the Huggingface CLI and download the necessary models (Wan2.1-I2V-14B-720P, wav2vec2-base-960h, and FantasyTalking checkpoint) to local directories. ```Bash 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 FantasyTalking Models using ModelScope CLI Source: https://github.com/fantasy-amap/fantasy-talking/blob/main/README.md Commands to install the ModelScope CLI and download the necessary models (Wan2.1-I2V-14B-720P, wav2vec2-base-960h, and FantasyTalking checkpoint) to local directories. ```Bash 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 ``` -------------------------------- ### List Python Project Dependencies Source: https://github.com/fantasy-amap/fantasy-talking/blob/main/requirements.txt This snippet enumerates the Python packages and their exact versions necessary for the '/fantasy-amap/fantasy-talking' project. These dependencies are typically found in a `requirements.txt` file and are essential for setting up the project's runtime environment, ensuring all required libraries are installed and compatible. ```Python torch>=2.0.0 torchvision cupy-cuda12x transformers==4.46.2 controlnet-aux==0.0.7 imageio imageio[ffmpeg] safetensors einops sentencepiece protobuf modelscope ftfy librosa ``` -------------------------------- ### Run Basic FantasyTalking Inference Source: https://github.com/fantasy-amap/fantasy-talking/blob/main/README.md Command to run the 'infer.py' script with a specified image and audio path to generate a talking portrait. ```Bash python infer.py --image_path ./assets/images/woman.png --audio_path ./assets/audios/woman.wav ``` -------------------------------- ### Run FantasyTalking Inference with Prompt and CFG Scale Source: https://github.com/fantasy-amap/fantasy-talking/blob/main/README.md Command to run the 'infer.py' script, allowing control over the character's behavior using a text prompt and adjusting the prompt and audio CFG scales for more consistent lip-sync. ```Bash 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 ``` -------------------------------- ### Cite FantasyTalking Project Source: https://github.com/fantasy-amap/fantasy-talking/blob/main/README.md BibTeX entry for citing the FantasyTalking project, useful for academic papers and research. ```BibTeX @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} } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.