POST
/
image_editing
/
face_gen
Face generator
curl --request POST \
  --url https://modelslab.com/api/v6/image_editing/face_gen \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "prompt": "<string>",
  "face_image": "<string>",
  "width": 123,
  "height": 123,
  "num_inference_steps": 21,
  "guidance_scale": 10.5,
  "s_scale": 1,
  "samples": 1,
  "safety_checker": true,
  "safety_checker_type": "black",
  "base64": false,
  "style": "realistic",
  "webhook": "<string>",
  "track_id": 123
}'
{
  "status": "success",
  "generationTime": 123,
  "id": 123,
  "output": [
    "<string>"
  ],
  "proxy_links": [
    "<string>"
  ],
  "meta": {}
}
Image url generated will not be accessible after 24 hours, kindly save your image generations accordingly.

Facegen

Face gen endpoint result

Request

Make a POST request to below endpoint and pass the required parameters as a request body to the endpoint.
curl
--request POST 'https://modelslab.com/api/v6/image_editing/face_gen' \

Body

json
{  
  "key": "your_api_key",  
  "prompt": "pretty woman",  
  "negative_prompt": "anime, cartoon, drawing, big nose, long nose, fat, ugly, big lips, big mouth, face proportion mismatch, unrealistic, monochrome, lowres, bad anatomy, worst quality, low quality, blurry",  
  "face_image":"https://assets.modelslab.com/generations/568d6320-8b6c-4af8-8725-51c0c9f633a3",  
  "width": "512",  
  "height": "512",  
  "samples": "1",  
  "num_inference_steps": "21",  
  "safety_checker": false,  
  "base64": false,  
  "seed": null,  
  "guidance_scale": 7.5,  
  "webhook": null,  
  "track_id": null
}

Body

application/json
key
string
required

Your API Key used for request authorization

prompt
string
required

The text prompt describing the content you want in the generated image

face_image
string
required

Link or valid base64 data of the face you want your generations to resemble

width
integer

The width of the generated image, If not provided, the width of face_image is used

Required range: x <= 512
height
integer

The height of the generated image, If not provided, the height of face_image is used

Required range: x <= 768
num_inference_steps
enum<integer>

The number of denoising steps

Available options:
21,
31,
41
guidance_scale
number

The scale for classifier-free guidance

Required range: 1 <= x <= 20
s_scale
number
default:1

Adjust the weight of the face structure

Required range: 0 <= x <= 2
samples
integer

The number of images to be returned in response

Required range: x <= 2
safety_checker
boolean

Whether to run the safety checker

safety_checker_type
enum<string>
Available options:
black,
blur,
sensitive_content_text,
pixelate
base64
boolean
default:false

Set to true for base64 response

style
enum<string>
default:realistic
Available options:
comic,
chibi,
3d,
anime,
realistic
webhook
string<uri>

URL to receive POST API call when complete

track_id
integer

ID for webhook identification

Response

200 - application/json

Face generation response

status
enum<string>
Available options:
success
generationTime
number

Time taken to generate the image in seconds

id
integer

Unique identifier for the generation request

output
string<uri>[]

Array of generated image URLs

Array of proxy image URLs

meta
object

Metadata about the generation process