face-to-sticker
Turn a face into a sticker
1import requests
2import json
3
4url = "https://api.segmind.com/v1/face-to-sticker"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 411,
12 "image": "https://segmind-sd-models.s3.amazonaws.com/display_images/face-to-sticker-input.jpg",
13 "steps": 20,
14 "width": 1024,
15 "height": 1024,
16 "prompt": "a person",
17 "upscale": false,
18 "upscale_steps": 10,
19 "prompt_strength": 7,
20 "ip_adapter_noise": 0.5,
21 "ip_adapter_weight": 0.2,
22 "instant_id_strength": 1
23}
24
25response = requests.post(url, headers=headers, json=data)
26
27if response.status_code == 200:
28 result = response.json()
29 print(json.dumps(result, indent=2))
30else:
31 print(f"Error: {response.status_code}")
32 print(response.text)
1import requests
2import json
3
4url = "https://api.segmind.com/v1/face-to-sticker"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 411,
12 "image": "https://segmind-sd-models.s3.amazonaws.com/display_images/face-to-sticker-input.jpg",
13 "steps": 20,
14 "width": 1024,
15 "height": 1024,
16 "prompt": "a person",
17 "upscale": false,
18 "upscale_steps": 10,
19 "prompt_strength": 7,
20 "ip_adapter_noise": 0.5,
21 "ip_adapter_weight": 0.2,
22 "instant_id_strength": 1
23}
24
25response = requests.post(url, headers=headers, json=data)
26
27if response.status_code == 200:
28 result = response.json()
29 print(json.dumps(result, indent=2))
30else:
31 print(f"Error: {response.status_code}")
32 print(response.text)
API Endpoint
https://api.segmind.com/v1/face-to-sticker
Parameters
height
optionalinteger
1024
image
optionalstring (uri)
An image of a person to be converted to a sticker
"https://segmind-sd-models.s3.amazonaws.com/display_images/face-to-sticker-input.jpg"
instant_id_strength
optionalnumber
How strong the InstantID will be.
1
Range: 0 - 1ip_adapter_noise
optionalnumber
How much noise is added to the IP adapter input
0.5
Range: 0 - 1ip_adapter_weight
optionalnumber
How much the IP adapter will influence the image
0.2
Range: 0 - 1negative_prompt
optionalstring
Things you do not want in the image
""
prompt
optionalstring
"a person"
prompt_strength
optionalnumber
Strength of the prompt. This is the CFG scale, higher numbers lead to stronger prompt, lower numbers will keep more of a likeness to the original.
7
seed
optionalinteger
Fix the random seed for reproducibility
321312
steps
optionalinteger
20
upscale
optionalboolean
2x upscale the sticker
false
upscale_steps
optionalinteger
Number of steps to upscale
10
width
optionalinteger
1024
Response Type
Returns: Image
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out