HyperSwap by FaceFusion Labs

Hyperswap enables high-quality, natural face swapping built for real production use.

~7.72s
$0.1 per generation
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/faceswap-hyperface-by-facefusion"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "source_image": "https://segmind-resources.s3.amazonaws.com/input/239704fa-c11a-4a80-a124-c61c30de07c0-hyperswap-source.jpg",
12    "target_image": "https://segmind-resources.s3.amazonaws.com/input/d4966189-937c-42e1-b047-9d11ebb81feb-hyperswap-target.jpg",
13    "model_name": "hyperswap_1c",
14    "output_format": "webp",
15    "output_quality": 70
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21    result = response.json()
22    print(json.dumps(result, indent=2))
23else:
24    print(f"Error: {response.status_code}")
25    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/faceswap-hyperface-by-facefusion

Parameters

source_imagerequired
string (uri)

Input URL or base64 string of the face image. Recommended for high-quality source images.

target_imagerequired
string (uri)

URL or base64 string of the target image. Best if it has clear facial details.

model_nameoptional
string

Select the model variant; choose 1a for speed, 1c for quality.

Default: "hyperswap_1c"
Allowed values :
"hyperswap_1a""hyperswap_1b""hyperswap_1c"
output_formatoptional
string

Choose output format; JPEG for compatibility, PNG for lossless quality.

Default: "webp"
Allowed values :
"jpeg""png""webp"
output_qualityoptional
integer

Set image quality; 70 for web, 95 for print.

Default: 70Range: 10 - 100

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out