POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 const axios = require('axios'); const fs = require('fs'); const path = require('path'); async function toB64(imgPath) { const data = fs.readFileSync(path.resolve(imgPath)); return Buffer.from(data).toString('base64'); } const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/face-detailer"; const data = { "image": "toB64('https://segmind-sd-models.s3.amazonaws.com/display_images/face-detailer-test-ip.png')", "prompt": "clear face and natural skin", "negative_prompt": "bad quality, painting, blur", "samples": 1, "num_inference_steps": 25, "guidance_scale": 5, "seed": 12467, "denoise": 0.4, "image_format": "jpeg", "image_quality": 95, "base64": false }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


imageimage *

Input image


promptstr *

The positive prompt describing the image


negative_promptstr ( default: bad quality, painting, blur )

Negative prompt to avoid undesired features in the image


samplesint ( default: 1 )

Number of image samples to generate

min : 1,

max : 4


num_inference_stepsint ( default: 20 )

Number of inference steps for image generation

min : 15,

max : 75


guidance_scalefloat ( default: 6 )

Guidance scale for generating the image

min : 5,

max : 10


seedint ( default: 12467 )

Random seed for image generation


denoisefloat *

Denoising strength to apply during generation

min : 0,

max : 1


image_formatenum:str ( default: jpeg )

Format of the output image

Allowed values:


image_qualityint ( default: 95 )

Quality of the output image

min : 10,

max : 100


base64boolean ( default: 1 )

Base64 encoding of the output image.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Face Detailer

Face Detailer is an advanced AI tool designed to enhance and restore facial features in images. Face Detailer is perfect for restoring characters’ faces in images. Its comprehensive processing pipeline ensures high-quality facial detail enhancement, making it an essential tool for photographers and digital artists.

Key Features of Face Detailer

  • Automatically detects and improves facial details in images. Ideal for repairing low-resolution faces with high-resolution synthesis.

  • Utilizes a two-step method for severely damaged faces. The first pass recreates the fundamental outline, while the second pass focuses on detailed reconstruction.

  • Eliminates distortion caused by the background.Ensures enhancements are aligned with face contours without affecting surrounding areas.

  • Upscales images to significantly increase resolution. Enhances details and reduces artifacts, perfect for high-resolution stills.

Use Cases

Face Detailer is perfect for restoring characters’ faces in various image formats. Its comprehensive processing pipeline ensures high-quality facial detail enhancement, making it an essential tool for photographers and digital artists.