A high-performance, real-time face swapping application with web interface and public access capabilities.
Face Swap Live provides real-time face swapping through a web browser interface. The application features GPU acceleration, automatic model management, and integrated ngrok support for public access. It's designed for both local development and cloud deployment (Google Colab).
- Real-time Processing: GPU-accelerated face swapping with optimized performance
- Web Interface: Browser-based interface accessible from any device
- Public Access: Integrated ngrok support for sharing and remote access
- Automatic Setup: Models download automatically on first run
- Cloud Ready: Full Google Colab support with one-click deployment
- Professional Grade: Enterprise-ready codebase with comprehensive logging
git clone https://github.com/Userfrom1995/FaceSwapLive.git
cd FaceSwapLive
pip install -r requirements.txt
python app.pyOpen the notebook directly in Colab:
python app.py --ngrok --ngrok-auth-token YOUR_TOKENFaceSwapLive/
├── app.py # Main application entry point
├── server.py # Optimized Flask server
├── pipeline.py # Face processing pipeline
├── models.py # Model management and downloading
├── config.py # Configuration management
├── ngrok_manager.py # Ngrok tunnel management
├── FaceSwapLive.ipynb # Google Colab notebook
├── models/ # AI models directory
│ └── instructions.txt # Model setup instructions
├── templates/ # Web interface templates
├── static/ # Static assets (CSS, JS)
├── docs/ # Documentation
└── requirements.txt # Python dependencies
Face Swap Live uses two AI models that download automatically:
- inswapper_128.onnx (530MB) - Face swapping model
- GFPGANv1.4.pth (332MB) - Face enhancement model
Manual download instructions are available in models/instructions.txt.
- GPU: 4GB+ VRAM (NVIDIA with CUDA support)
- RAM: 8GB+
- Storage: 2GB free space
- GPU: 2GB VRAM or CPU processing
- RAM: 4GB
- Storage: 1GB free space
- Start server:
python app.py - Open browser to displayed URL
- Upload source face image
- Enable webcam for real-time face swapping
- Get ngrok auth token from ngrok.com
- Run:
python app.py --ngrok --ngrok-auth-token YOUR_TOKEN - Share the generated public URL
- Open notebook in Colab
- Execute all cells in order
- Replace auth token placeholder with your token
- Access via generated public URL
Configuration is managed through config.py. Key settings:
- Server: Host, port, and performance settings
- Processing: Frame rate, quality, and optimization
- Models: Model paths and download URLs
- Ngrok: Tunnel configuration and security
- Security: Rate limiting and access control
- Installation - Setup instructions
- Ngrok Setup - Public access configuration
- Arguments Reference - Command line options
- Configuration - Configuration options
- API Reference - Server endpoints and WebSocket events
- Troubleshooting - Common issues and solutions
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License. See LICENSE for details.
The idea for Face Swap Live came from a simple need: most face swapping applications I found were GUI-based desktop applications that were difficult to set up and configure. I wanted something web-based that would be easy to set up and quick to use - just for fun! That's where it all began.
The goal was to create a simple, accessible face swapping experience that anyone could use through their browser without complex installation procedures.
This project uses AI models and libraries from the open-source community:
- InsightFace - Face analysis and detection models
- GFPGAN - Face enhancement technology
- Flask & SocketIO - Web framework and real-time communication
- ONNX Runtime - Model inference optimization
All models and libraries are used in accordance with their respective licenses.
- Issues: Report bugs and feature requests via GitHub Issues
- Documentation: Check the
docs/directory for detailed guides - Community: Join discussions in GitHub Discussions
This software is intended for educational, research, and entertainment purposes only.
- You MUST obtain explicit consent before processing any person's image
- Using images without consent may violate privacy laws and ethical standards
- The responsibility for obtaining consent lies solely with the user
- Creating non-consensual intimate imagery
- Harassment, bullying, or defamation
- Identity theft or impersonation
- Spreading misinformation or fake content
- Any illegal or unauthorized activities
- Users are solely responsible for their use of this software
- Users must comply with all applicable laws and regulations
- Users must respect the privacy and dignity of all individuals
- Users should clearly disclose when content has been modified using AI
- The developers provide this software "as is" without any warranties
- The developers are not responsible for any misuse of this software
- The developers do not endorse or support any unethical or illegal use
- Users assume all risks and legal responsibilities for their actions
By using this software, you acknowledge that you have read, understood, and agree to comply with these ethical guidelines and legal requirements.
Remember: Always use this technology responsibly and ethically. Obtain consent, respect privacy, and follow all applicable laws.