Skip to main content

Dzine - Face Swapper

Advanced AI-powered face swapping that digitally transfers facial features from a source image onto a target image while preserving original facial expressions, lighting, and details.

Endpoint

Request Headers

FieldValue
API-KEY<api-key>
Content-Typeapplication/json

Parameters

ParameterTypeRequiredDescription
typestringYesFeature type identifier. Must be FACE_SWAPPER
modelstringYesAI model identifier. Must be dzine
promptObjectobjectYesConfiguration object containing face swap parameters

Prompt Object Parameters

ParameterTypeRequiredDescriptionDefault
swapImageUrlstringYesAsset path to the destination image where the face will be swapped to. Example: development/images/2025_11_05_22_13_08_115_547133.webp-
targetImageUrlstringYesAsset path to the source image containing the face to be transferred. Example: development/images/2025_11_05_22_13_08_115_547135.webp-
nnumberYesNumber of face swap variations to generate (1-4)1
output_formatstringNoOutput format: "webp" or "jpeg""webp"

Image Requirements

  • Maximum Size: 50 MB
  • Formats: JPG, PNG, WebP supported as input

Code Examples

curl --location 'https://api.1min.ai/api/features' \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"type": "FACE_SWAPPER",
"model": "dzine",
"promptObject": {
"swapImageUrl": "development/images/target_person.jpg",
"targetImageUrl": "development/images/source_face.jpg",
"n": 2,
"output_format": "webp"
}
}'

Interactive Playground

API Playground

https://api.1min.ai/api/features
Asset path to target image (face will be replaced)
Asset path to source image (face to transfer)
Number of face swap variations to generate (1-4)
Output image format

Generated cURL Command:

curl -X POST "https://api.1min.ai/api/features" \
-H "API-KEY: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "FACE_SWAPPER",
"model": "dzine",
"promptObject": {
"swapImageUrl": "development/images/target_person.jpg",
"targetImageUrl": "development/images/source_face.jpg",
"n": 2,
"output_format": "webp"
}
}'

Response Format

{
"aiRecord": {
"uuid": "e40dd9ef-0944-4ce5-bc90-1edd2548619a",
"userId": "f944dd01-da40-405c-b698-708269eb9664",
"teamId": "7d530bad-357c-4f6e-b627-16f043c9a16b",
"teamUser": {
"teamId": "7d530bad-357c-4f6e-b627-16f043c9a16b",
"userId": "f944dd01-da40-405c-b698-708269eb9664",
"userName": "test",
"userAvatar": null,
"status": "ACTIVE",
"role": "ADMIN",
"creditLimit": 100000000,
"usedCredit": 8370000,
"createdAt": "2025-10-31T06:24:14.102Z",
"createdBy": "SYSTEM",
"updatedAt": "2025-11-05T15:54:56.422Z",
"updatedBy": "SYSTEM"
},
"model": "dzine",
"type": "FACE_SWAPPER",
"metadata": null,
"rating": null,
"feedback": null,
"conversationId": null,
"status": "SUCCESS",
"createdAt": "2025-11-05T15:59:57.291Z",
"aiRecordDetail": {
"promptObject": {
"n": 1,
"swapImageUrl": "development/images/target_person.jpg",
"output_format": "webp",
"targetImageUrl": "development/images/source_face.jpg"
},
"resultObject": [
"development/images/2025_11_05_22_59_58_236_378180.webp"
],
"responseObject": {}
},
"additionalData": null,
"temporaryUrl": ""
}
}

Use Cases

  • Entertainment & Social Media: Create fun face swaps for social content
  • Visual Effects: Professional face replacement for film and video
  • Avatar Creation: Generate personalized avatars and profile images
  • Try-Before-You-Buy: Virtual makeup or hairstyle previews
  • Historical Recreation: Place modern faces in historical contexts
  • Marketing: Create personalized promotional materials

Tips for Best Results

  1. Image Selection:

    • Use clear, front-facing or slightly angled faces
    • Ensure good lighting in both images
    • Avoid extreme angles or partially obscured faces
    • Face proportion should be less than 80% of total image
  2. Image Quality:

    • Higher resolution images produce better results
    • Clear facial features improve detection accuracy
    • Avoid heavily compressed or low-quality images
    • Ensure proper image orientation before upload
  3. Multiple Variations:

    • Generate 2-4 variations to get the best result
    • Different slots may work better depending on image type
    • For realistic photos, slots 2 and 4 often perform best
    • For artistic images, slots 1 and 3 are optimized

Face Detection Behavior

The system automatically handles face detection with the following logic:

  1. Both faces detected: Normal face swap proceeds
  2. Source face not detected: Returns original target image (no swap)
  3. Target face not detected: Returns original target image (no swap)
  4. No faces detected: Returns original target image (no swap)
Charges Apply

Face detection API calls are charged even when no faces are detected. This ensures fair billing for API usage regardless of detection results.