Face Swap
Seamlessly swap faces between images while maintaining natural appearance. This tool takes two images - a source image containing the face you want to use and a target image where you want to apply the face.
Request Format
Send a POST request to the generate endpoint with the following parameters:
Required Parameters
initImage
: Base64 encoded target image (where you want to apply the face)faceswapImage
: Base64 encoded source image (containing the face you want to use)imageNumber
: Must be set to "1" for tool operationsgenerationMode
: Must be set to "TOOLS"toolType
: Must be set to "Faceswap"webhookUrl
: URL where the generated image will be sent upon completion
Optional Parameters
previousBatch
: String - ID of a previous batch to group resultsfolderId
: String - Folder ID for organization (default: "0")
Image Requirements
For best results, ensure that:
- The source image contains a clear, front-facing face
- The target image has similar face positioning for optimal swapping
- Both images have good lighting and resolution
Try it out
Example Request
curl -X POST https://api.supermachine.art/v1/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"webhookUrl": "https://your-webhook-url.com/callback",
"imageNumber": "1",
"generationMode": "TOOLS",
"toolType": "Faceswap",
"previousBatch": "1208674",
"folderId": "0",
"initImage": "BASE64_INPUT",
"faceswapImage": "BASE64_HERE"
}'
ⓘ Add your API key above to try this endpoint
Important Notes
- Both input images must be base64 encoded
- Maximum input image size is 1.2MB for each image
- Supported input formats: PNG, JPEG, WebP
- The API response will include:
{ "batchID": 1208513, "method": "Faceswap", "type": "TOOLS", "paidCredits": 12776, "subscriptionCredits": 2846.400000000003, "imageIds": [ 6370941 ] }
- The generated image will be sent to your webhook URL when processing is complete