Qubico Face Swap API Reference
Complete API documentation for advanced AI-powered face swapping in images and videos.
Base URL
https://api.qubico.ai/v1/inference
Header Params
x-api-key: YOUR_API_KEY
Model ID
Qubico/image-toolkit, Qubico/video-toolkit
Single Face Swap Request
{
"model": "Qubico/image-toolkit",
"task_type": "face-swap",
"input": {
"target_image": "https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg",
"swap_image": "https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg"
}
}
Required Parameters
model
Model identifier. Use Qubico/image-toolkit
for image processing or Qubico/video-toolkit
for video processing.
task_type
Task type: face-swap
for single face or video, multi-face-swap
for multiple faces.
target_image
URL of the target image where faces will be replaced. Supports JPEG, PNG formats.
swap_image
URL of the source image containing the face(s) to be swapped in. Supports JPEG, PNG formats.
Optional Parameters
target_video
URL of the target video for video face swap. Supports MP4, AVI, MOV formats. Use with video-toolkit model.
swap_faces_index
Comma-separated indices of faces in the swap image to use. Default: "0" (first face). Example: "0,1,2".
target_faces_index
Comma-separated indices of faces in the target image/video to replace. Default: "0" (first face). Example: "0,1,2".
Configuration Parameters
webhook_config
Webhook configuration for receiving completion notifications. Contains endpoint
and secret
fields.
Successful Response
{
"task_id": "task_12345678",
"status": "completed",
"result": {
"output_url": "https://storage.qubico.ai/results/faceswap_result.jpg"
},
"created_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T10:30:15Z"
}
cURL Request
curl -X POST "https://api.qubico.ai/v1/inference" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Qubico/image-toolkit",
"task_type": "face-swap",
"input": {
"target_image": "https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg",
"swap_image": "https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg"
}
}'
Please refer to our Pricing Page for detailed information on rate limits and pricing.
✅ Recommended
- •Use high-resolution images (1024x1024 or higher) for better results
- •Ensure faces are clearly visible and well-lit
- •Use frontal or near-frontal face angles for optimal swapping
- •Test with single face swap before attempting multi-face
- •Use webhook for long-running video processing tasks
❌ Avoid
- •Very low resolution or blurry images
- •Extreme face angles or profile views
- •Images with multiple overlapping faces
- •Using incorrect face indices for multi-face swap
- •Processing very long videos without webhook setup
Image Support
- Formats: JPEG, PNG, WebP
- Max Size: 50MB per image
- Resolution: Up to 4096x4096
- Min Resolution: 256x256
Video Support
- Formats: MP4, AVI, MOV
- Max Size: 500MB per video
- Max Duration: 60 seconds
- Resolution: Up to 1920x1080