Skip to content

bytes-arena/ai_avatar

Repository files navigation

SadTalker: Talking Face Generation

This project generates a talking face video driven by an input audio and source image using the SadTalker framework.
This guide provides complete setup instructions for Windows (Python 3.9, CPU version).


🧩 Prerequisites

1. Install Python 3.9

Download and install Python 3.9 (64-bit) from:
👉 https://www.python.org/downloads/release/python-390/

During installation:

  • Check “Add Python to PATH”
  • Then click Install Now

Verify installation:

python --version

2. 🎞️ Install FFmpeg

SadTalker depends on FFmpeg for video/audio processing.

  • Option A – Install via Winget
winget install ffmpeg
  • Option B – Manual installation
Download ZIP from https://ffmpeg.org/download.html

Extract to C:\ffmpeg

Add C:\ffmpeg\bin to System PATH

Verify:

ffmpeg -version

3. Setup Project Folder

Create new folder and clone the project

mkdir E:\Project_SadTalker
cd E:\Project_SadTalker
git clone https://github.com/<your-github-username>/<your-repo-name>.git
cd <your-repo-name>

4. Create and Activate Virtual Environment

py -3.9 -m venv venv
venv\Scripts\activate

Verify python version

python -V

It should show something like

Python 3.9.x

5. ⚙️ Install Dependencies

cd sadtalker
pip install torch==1.12.1+cpu torchvision==0.13.1+cpu torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cpu
python -m pip install basicsr==1.4.2 filterpy==1.4.5 gfpgan==1.3.8 facexlib==0.3.0  
pip install -r requirements.txt

6. 📦 Download Pretrained Models

Download pretrained models weights by running script download_models.py

python download_models.py

This will create two new folders, checkpoints and gfpgan/weights

7. Prepare Input Files

Two types of files are required: image (avatar image) and audio (spoken audio file .wav) To create avatar image, run the script named as get_avatar_image.py, replace openai api key with one you have, change input prompt and output image path as required and then run

python get_avatar_image.py

Verify the quality and accuracy of created avatar image, if not satisfied you can re run the script and check what model outputs.

8. Run Inference Script

Open the script named as run_inference.py, change source_image_path and audio_path as required and run the script using command

python run_inference.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors