Real-time face swap application optimized for Apple Silicon (M1/M2/M3) with OBS Studio integration.
Developed by Ilyas AKKUS
- Real-time face swapping using a single source image
- Optimized for Apple Silicon using CoreML
- OBS Studio virtual camera integration
- Low latency for live streaming
- Simple GUI interface
- macOS with Apple Silicon (M1/M2/M3)
- Python 3.10 (IMPORTANT: Must use Python 3.10, not newer versions)
- OBS Studio
- Webcam
# Install Python 3.10 using Homebrew
brew install python@3.10
# Verify installation
python3.10 --version
# Create virtual environment with Python 3.10
python3.10 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install requirements
pip install -r requirements.txt
Models will be automatically downloaded on first run (~300MB).
-
Activate virtual environment:
source venv/bin/activate
-
Run the application:
python3.10 run.py --execution-provider coreml
-
Select source face image
-
Click "Live" to start webcam mode
-
Use OBS Studio to capture the output window
- Open OBS Studio
- Add a new "Window Capture" source
- Select the Deepfake Live Camera preview window
- Alternatively, use "Display Capture" to capture the entire screen
- Use high-quality source images with clear face visibility
- Ensure good lighting for webcam
- Source image should have similar angle to your webcam position
- Close-up portraits work best
-
"_tkinter not found" error:
brew reinstall python-tk@3.10
-
Python version conflicts:
# Always use python3.10 explicitly python3.10 run.py --execution-provider coreml
-
Performance issues:
- Make sure to use CoreML execution provider for Apple Silicon
- Close unnecessary applications
- Reduce preview window size if needed
The application supports three performance modes that can be set using the --performance
flag:
python3.10 run.py --performance [fast|balanced|quality]
-
fast: Best performance, lower quality
- Reduced resolution (40% of original)
- Higher frame skip rate
- Recommended for live streaming
-
balanced: Good balance between performance and quality
- Medium resolution (50% of original)
- Moderate frame skip rate
- Good for general use
-
quality: Highest quality, lower performance
- Higher resolution (80% of original)
- Lower frame skip rate
- Best for recording
-
CoreML Settings:
- Uses Neural Engine for inference
- Optimized model conversion for M2
- Efficient memory management
-
System Recommendations:
- Set Mac power settings to "High Performance"
- Ensure proper cooling
- Close resource-intensive applications
- Keep macOS updated
-
Performance Tips:
- Use "fast" mode for live streaming
- Disable lip sync if not needed
- Use lower resolution webcam if available
- Monitor FPS counter in the application
You can combine performance settings with other options:
# Fast mode with specific camera
python3.10 run.py --performance fast --camera-id 1
# Balanced mode without GUI
python3.10 run.py --performance balanced --no-gui --source path/to/image.jpg
This project is licensed under AGPL-3.0 License.