This is the deepfake video generation service for OpenClone, based on the open-source SadTalker project. It generates talking head videos by combining a static image with audio input through a Flask REST API. The service includes custom M3U8 HLS streaming for real-time playback, comprehensive logging via LogWeaver, and GPU acceleration support.
The implementation wraps the core SadTalker functionality with OpenClone-specific enhancements including dual output formats (MP4 and M3U8), animation parameter caching, and integration with the shared OpenCloneFS file system.
Linux Container (Recommended):
Build container: docker build --no-cache -t openclone-sadtalker:1.0 .
Run using script: /StartStopScripts/SadTalker/start.bat
Windows Development:
- Install VS Code Theme Shades of Purple
- Install Python 3.8.8
- Install CUDA Toolkit 11.8
git clone https://github.com/smchughinfo/SadTalker.gitcd SadTalkercode .ctrl+shift+p > Python: Create Environment > Venv > Python 3.8.8rc 64-bit- ..venv\Scripts\activate
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118pip install -r SadTalker/requirements.txt- Download AI Model Checkpoints: Extract and place in
SadTalker/checkpoints/directory- Official: SadTalker Models (Original from SadTalker GitHub)
- Mirror: Backup Models (OpenClone mirror)
Note: torchvision==0.17.0+ removes functions required by SadTalker. GeForce drivers must support CUDA 11.8.
Set required environment variables (see root README.md for complete list). The service runs as a Flask API on port 5001. Send POST requests to /generate-deepfake with parameters for image path, audio path, and output format (mp4Path or m3u8Path). Use cpu=1 parameter to force CPU processing instead of GPU.
For more technical details and API documentation, see CLAUDE.md.
