Face Swap
Pricing
from $0.00005 / actor start
Face Swap
Swap faces between images using advanced AI deep learning for natural, high-resolution results. Ideal for dev teams, automated workflows, creators, influencers, and marketers.
Pricing
from $0.00005 / actor start
Rating
5.0
(2)
Developer
Akash Kumar Naik
Actor stats
2
Bookmarked
71
Total users
9
Monthly active users
3 days ago
Last modified
Categories
Share
AI Face Swap Actor
Deep learning-powered face swapping tool for professional image transformation. Swap faces between two images using state-of-the-art InsightFace models.
Overview
The AI Face Swap Actor enables you to automatically replace faces in images using advanced deep learning technology. Provide a source image (containing the face you want to use) and a target image (where you want the face applied), and receive a high-quality face-swapped result.
This tool is optimized for the Apify platform with efficient memory management, fast processing times, and reliable cloud execution.
Features
- Deep Learning Face Swap - Advanced AI models for natural, realistic face swapping
- Cloud Storage Support - Works with Google Drive, Dropbox, OneDrive, iCloud, and Box links
- High Quality Output - PNG lossless or JPEG optimized output formats
- Memory Optimized - Efficient resource management for stable performance
- Fast Processing - Pre-downloaded models for quick execution
- Graceful Shutdown - Automatic state preservation for interrupted runs
Use Cases
- Portrait Photography - Swap faces for creative photography projects
- Image Editing - Professional face replacement for compositing
- Content Creation - Generate unique images for marketing and social media
- Film & Video Production - Face replacement for visual effects workflows
- Gaming & Virtual Avatars - Create custom character faces
Pricing
This Actor uses pay-per-event pricing model:
| Event | Description | Price |
|---|---|---|
| Face Swap Result | Successful face swap with delivered output | $0.025 |
| Face Swap Error | Failed operation after processing began | $0.005 |
Users set a maximum spending limit per run in Apify Console.
Input
| Field | Type | Description |
|---|---|---|
sourceUrl | string | URL of image containing the face to use for swapping |
targetUrl | string | URL of image where the face will be applied |
outputFormat | string | Output format: PNG (lossless) or JPEG (smaller) |
Supported URL Formats
- Direct image URLs (HTTP/HTTPS)
- Google Drive sharing links
- Dropbox sharing links
- OneDrive sharing links
- iCloud sharing links
- Box sharing links
- MediaFire sharing links
Output
The Actor returns a dataset item containing:
{"success": true,"sourceUrl": "https://example.com/source.jpg","targetUrl": "https://example.com/target.jpg","processingTime": 12.5,"fileSize": 1048576,"outputFormat": "PNG","resultUrl": "https://api.apify.com/v2/key-value-stores/...","timestamp": 1700000000}
How It Works
- Download Images - Both source and target images are fetched from provided URLs
- Face Detection - AI analyzes both images to locate and extract faces
- Face Swapping - The source face is mapped onto the target face using deep learning
- Result Delivery - Output image is stored and URL is returned in dataset
The Actor uses the InsightFace Buffalo-L model for face analysis and the Inswapper 128 model for face swapping, ensuring high-quality results with natural-looking transformations.
Performance Notes
- Processing time typically ranges from 10-30 seconds depending on image size
- Memory usage is optimized for runs up to 4GB RAM
- Images are automatically resized if larger than 2048px to optimize processing
Error Handling
The Actor handles various error conditions:
- Invalid URL formats
- Image download failures
- Private IP address detection (blocked for security)
- No faces detected in images
- Processing failures
Failed operations return error dataset items with descriptive messages.
FAQ
Q: What image formats are supported? A: Input supports JPG, JPEG, PNG, and WebP. Output can be PNG (lossless) or JPEG (optimized).
Q: Can I use faces from cloud storage? A: Yes, the Actor automatically converts Google Drive, Dropbox, OneDrive, iCloud, Box, and MediaFire sharing links to direct download URLs.
Q: What happens if no face is detected? A: The Actor returns an error item with "No faces detected" message. No charge is applied for this case.
Q: Is there a size limit for images? A: Images over 15MB or larger than 2048px dimension are rejected with appropriate error messages.
Q: How accurate is the face swap? A: The AI produces natural-looking results with proper lighting and blending. Complex lighting or unusual angles may affect quality.
Related Tools
- AI Image Processing - Other image transformation Actors
- Face Detection - Extract faces from images
- Background Removal - Remove backgrounds from images
Technical Details
| Specification | Value |
|---|---|
| Runtime | Python 3.11 |
| Memory | 1GB - 4GB |
| Models | InsightFace Buffalo-L, Inswapper 128 ONNX |
| CPU | Optimized for 2 threads |
| Timeout | 120 seconds default |
Support
For issues, feature requests, or custom implementations, open a GitHub issue or contact the developer.
License
MIT License - See repository for details.