Face Detailer

Restore characters' faces to their original glory with Face Detailer. Enhance facial details, eliminate distortion, and upscale images for stunning results.

~16.07s
~$0.015
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/face-detailer"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "image": "https://segmind-sd-models.s3.amazonaws.com/display_images/face-detailer-test-ip.png",
12    "prompt": "clear face and natural skin",
13    "negative_prompt": "bad quality, painting, blur",
14    "samples": 1,
15    "num_inference_steps": 25,
16    "guidance_scale": 5,
17    "seed": 12467,
18    "denoise": 0.4,
19    "image_format": "jpeg",
20    "image_quality": 95,
21    "base64": false
22}
23
24response = requests.post(url, headers=headers, json=data)
25
26if response.status_code == 200:
27    result = response.json()
28    print(json.dumps(result, indent=2))
29else:
30    print(f"Error: {response.status_code}")
31    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/face-detailer

Parameters

denoiserequired
number

Denoising strength to apply during generation

Default: 0.5Range: 0 - 1
imagerequired
string (uri)

Input image

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/face-detailer-test-ip.png"
promptrequired
string

The positive prompt describing the image

Default: "clear face and natural skin"
base64optional
boolean

Base64 encoding of the output image.

Default: false
guidance_scaleoptional
number

Guidance scale for generating the image

Default: 6Range: 5 - 10
image_formatoptional
string

Format of the output image

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

Quality of the output image

Default: 95Range: 10 - 100
negative_promptoptional
string

Negative prompt to avoid undesired features in the image

Default: "bad quality, painting, blur"
num_inference_stepsoptional
integer

Number of inference steps for image generation

Default: 20Range: 15 - 75
samplesoptional
integer

Number of image samples to generate

Default: 1Range: 1 - 4
seedoptional
integer

Random seed for image generation

Default: 12467

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