Face Swap avatar

Face Swap

Pricing

from $0.00005 / actor start

Go to Apify Store
Face Swap

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

Akash Kumar Naik

Maintained by Community

Actor stats

2

Bookmarked

71

Total users

9

Monthly active users

3 days ago

Last modified

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:

EventDescriptionPrice
Face Swap ResultSuccessful face swap with delivered output$0.025
Face Swap ErrorFailed operation after processing began$0.005

Users set a maximum spending limit per run in Apify Console.

Input

FieldTypeDescription
sourceUrlstringURL of image containing the face to use for swapping
targetUrlstringURL of image where the face will be applied
outputFormatstringOutput 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

  1. Download Images - Both source and target images are fetched from provided URLs
  2. Face Detection - AI analyzes both images to locate and extract faces
  3. Face Swapping - The source face is mapped onto the target face using deep learning
  4. 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.

  • AI Image Processing - Other image transformation Actors
  • Face Detection - Extract faces from images
  • Background Removal - Remove backgrounds from images

Technical Details

SpecificationValue
RuntimePython 3.11
Memory1GB - 4GB
ModelsInsightFace Buffalo-L, Inswapper 128 ONNX
CPUOptimized for 2 threads
Timeout120 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.