POST
/
image_editing
/
head_shot
Head shot generator
curl --request POST \
  --url https://modelslab.com/api/v6/image_editing/head_shot \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "prompt": "<string>",
  "face_image": "<string>",
  "width": 123,
  "height": 123,
  "num_inference_steps": 21,
  "guidance_scale": 3,
  "s_scale": 1,
  "samples": 1,
  "safety_checker": true,
  "safety_checker_type": "black",
  "base64": false,
  "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

Head Shot

Head-Shot 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/head_shot' \

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

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

Width of your generated image, If not provide width of face_image is used

Required range: x <= 512
height
integer

Height of your generated image, If not provide height of face_image is used

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

Number of denoising steps

Available options:
21,
31,
41
guidance_scale
integer

Scale for classifier-free guidance

Required range: 1 <= x <= 5
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

webhook
string<uri>

URL to receive POST API call when complete

track_id
integer

ID for webhook identification

Response

200 - application/json

Head shot 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