face-to-sticker Serverless API
Turn a face into a sticker
POST /v2/face-to-sticker · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "face-to-sticker",
9 seed=411,
10 image="https://segmind-sd-models.s3.amazonaws.com/display_images/face-to-sticker-input.jpg",
11 steps=20,
12 width=1024,
13 height=1024,
14 prompt="a person",
15 upscale=False,
16 upscale_steps=10,
17 prompt_strength=7,
18 ip_adapter_noise=0.5,
19 ip_adapter_weight=0.2,
20 instant_id_strength=1,
21)
22print(result["status"]) # COMPLETED
23print(result.get("output")) # model output (e.g. media URL)
24print(result["metrics"]["inference_time"]) # server compute seconds
25
26# --- Or submit + poll manually (track request_id, control the cadence) ---
27from segmind import SegmindClient, InferenceFailed, InferenceTimeout
28
29client = SegmindClient() # reads SEGMIND_API_KEY
30payload = {
31 "seed": 411,
32 "image": "https://segmind-sd-models.s3.amazonaws.com/display_images/face-to-sticker-input.jpg",
33 "steps": 20,
34 "width": 1024,
35 "height": 1024,
36 "prompt": "a person",
37 "upscale": False,
38 "upscale_steps": 10,
39 "prompt_strength": 7,
40 "ip_adapter_noise": 0.5,
41 "ip_adapter_weight": 0.2,
42 "instant_id_strength": 1,
43}
44job = client.submit_async("face-to-sticker", **payload)
45print(job.request_id) # available immediately
46try:
47 result = job.wait(timeout=600, interval=1.0)
48except InferenceTimeout as e:
49 print("still running:", e.request_id)
50except InferenceFailed as e:
51 print("failed:", e.detail) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "face-to-sticker",
9 seed=411,
10 image="https://segmind-sd-models.s3.amazonaws.com/display_images/face-to-sticker-input.jpg",
11 steps=20,
12 width=1024,
13 height=1024,
14 prompt="a person",
15 upscale=False,
16 upscale_steps=10,
17 prompt_strength=7,
18 ip_adapter_noise=0.5,
19 ip_adapter_weight=0.2,
20 instant_id_strength=1,
21)
22print(result["status"]) # COMPLETED
23print(result.get("output")) # model output (e.g. media URL)
24print(result["metrics"]["inference_time"]) # server compute seconds
25
26# --- Or submit + poll manually (track request_id, control the cadence) ---
27from segmind import SegmindClient, InferenceFailed, InferenceTimeout
28
29client = SegmindClient() # reads SEGMIND_API_KEY
30payload = {
31 "seed": 411,
32 "image": "https://segmind-sd-models.s3.amazonaws.com/display_images/face-to-sticker-input.jpg",
33 "steps": 20,
34 "width": 1024,
35 "height": 1024,
36 "prompt": "a person",
37 "upscale": False,
38 "upscale_steps": 10,
39 "prompt_strength": 7,
40 "ip_adapter_noise": 0.5,
41 "ip_adapter_weight": 0.2,
42 "instant_id_strength": 1,
43}
44job = client.submit_async("face-to-sticker", **payload)
45print(job.request_id) # available immediately
46try:
47 result = job.wait(timeout=600, interval=1.0)
48except InferenceTimeout as e:
49 print("still running:", e.request_id)
50except InferenceFailed as e:
51 print("failed:", e.detail)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
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/face-to-stickerSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
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