A cutting-edge AI makeup transfer application that combines Stable-Makeup technology with MediaPipe face detection to deliver professional-quality makeup application results.
SM Mirror 2.0 is a full-stack application that uses advanced AI to transfer makeup from reference images to source photos while maintaining natural facial features and professional-quality results.
- Professional Makeup Transfer: Powered by Stable-Makeup for superior results vs traditional inpainting
- Multi-Region Control: Separate control for lips, eyes, eyebrows, and cheeks
- Real-time Processing: FastAPI backend with async task processing
- Advanced Face Detection: Hybrid MediaPipe + SPIGA detection system
- Progressive Makeup: Multi-step makeup application
- GPU/CPU Support: Optimized for various hardware configurations
SM_Mirror_2.0/
βββ Stable-Makeup/ # Core Stable-Makeup implementation
βββ backend/ # FastAPI server & services
βββ pytorch_model_2/ # Pre-trained model weights
βββ output/ # Generated results
βββ tasks.md # Development roadmap
βββ instructions.md # Detailed development guide
- Python 3.8+
- CUDA-capable GPU (recommended)
- 16GB+ RAM
- 10GB+ disk space for models
# Clone the repository
git clone <your-repo-url>
cd SM_Mirror_2.0
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r backend/requirements_essential.txt
Models are automatically detected from:
pytorch_model_2/
(current setup)Stable-Makeup/models/
- Download from Google Drive
cd backend
python main.py
Server starts at http://localhost:8000
# Health check
curl http://localhost:8000/health
# Test makeup transfer
curl -X POST http://localhost:8000/api/v1/makeup/transfer \
-F "source_image=@path/to/source.jpg" \
-F "reference_image=@path/to/makeup_reference.jpg" \
--output result.jpg
GET /health
GET /api/v1/makeup/health
POST /api/v1/makeup/transfer
Content-Type: multipart/form-data
Fields:
- source_image: Source image file
- reference_image: Makeup reference image file
Response: Processed image with makeup applied
- Stable-Makeup: Professional makeup transfer model
- MediaPipe: Face landmark detection
- SPIGA: Advanced facial structure analysis
- Stable Diffusion v1.5: Base diffusion model
- PyTorch: Deep learning framework
- FastAPI: Modern Python web framework
- Uvicorn: ASGI server
- Pillow: Image processing
- NumPy: Numerical computations
- Docker: Containerization (planned)
- PostgreSQL: Database (planned)
- Redis/Celery: Async task processing (planned)
- Processing Time: 30-60 seconds per image (GPU)
- Quality: Professional-grade makeup transfer
- Memory Usage: ~6-8GB GPU memory
- Supported Formats: JPG, PNG, WebP
- β Lipstick: Various colors and finishes
- β Eye Makeup: Eyeshadow, eyeliner, mascara
- β Eyebrows: Shape and color enhancement
- β Blush: Cheek contouring and color
- π Foundation: Skin tone adjustment (planned)
- π Highlighter: Face highlighting (planned)
- Multi-region Control: Apply different makeup to different facial areas
- Style Mixing: Combine multiple reference styles
- Intensity Control: Adjust makeup strength
- Progressive Application: Step-by-step makeup building
- MediaPipe integration
- Stable-Makeup core functionality
- Basic API endpoints
- Complete end-to-end pipeline
- Frontend integration
- File upload/download
- Async processing
- Multi-region control
- User interface enhancements
- User authentication
- Multi-step makeup
- Performance optimization
- Deployment
# Test Stable-Makeup integration
python backend/test_stable_makeup.py
# Test API endpoints
python backend/test_api_upload.py
# Manual API testing
curl -X POST http://localhost:8000/api/v1/makeup/transfer \
-F "source_image=@test_images/source.jpg" \
-F "reference_image=@test_images/reference.jpg" \
--output result.jpg
cd backend
python main.py
- GPU-enabled cloud instances (AWS/GCP)
- Docker containerization
- Load balancing with Nginx
- Monitoring and logging
- 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 the LICENSE file for details.
- Stable-Makeup - Core makeup transfer technology
- MediaPipe - Face detection and landmarks
- SPIGA - Advanced facial analysis
- Hugging Face Diffusers - Diffusion model pipeline
- Check the Issues for common problems
- Review
instructions.md
for detailed development guidance - Check
tasks.md
for development progress
β
Backend Integration: Stable-Makeup + FastAPI working
β
Face Detection: MediaPipe + SPIGA hybrid system
β
API Endpoints: Upload and process images
β
Model Loading: Auto-detection of trained models
π Frontend: In development
π Production: Deployment preparation
Ready for makeup magic! πβ¨