face-to-sticker

Turn a face into a sticker

~65.52s
~$0.087
 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

POSThttps://api.segmind.com/v1/face-to-sticker

Parameters

heightoptional
integer
Default: 1024
imageoptional
string (uri)

An image of a person to be converted to a sticker

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/face-to-sticker-input.jpg"
instant_id_strengthoptional
number

How strong the InstantID will be.

Default: 1Range: 0 - 1
ip_adapter_noiseoptional
number

How much noise is added to the IP adapter input

Default: 0.5Range: 0 - 1
ip_adapter_weightoptional
number

How much the IP adapter will influence the image

Default: 0.2Range: 0 - 1
negative_promptoptional
string

Things you do not want in the image

Default: ""
promptoptional
string
Default: "a person"
prompt_strengthoptional
number

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.

Default: 7
seedoptional
integer

Fix the random seed for reproducibility

Default: 321312
stepsoptional
integer
Default: 20
upscaleoptional
boolean

2x upscale the sticker

Default: false
upscale_stepsoptional
integer

Number of steps to upscale

Default: 10
widthoptional
integer
Default: 1024

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out