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-stickerParameters
heightoptionalinteger1024imageoptionalstring (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_strengthoptionalnumberHow strong the InstantID will be.
1Range: 0 - 1ip_adapter_noiseoptionalnumberHow much noise is added to the IP adapter input
0.5Range: 0 - 1ip_adapter_weightoptionalnumberHow much the IP adapter will influence the image
0.2Range: 0 - 1negative_promptoptionalstringThings you do not want in the image
""promptoptionalstring"a person"prompt_strengthoptionalnumberStrength 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.
7seedoptionalintegerFix the random seed for reproducibility
321312stepsoptionalinteger20upscaleoptionalboolean2x upscale the sticker
falseupscale_stepsoptionalintegerNumber of steps to upscale
10widthoptionalinteger1024Response 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