face-to-sticker Serverless API

Turn a face into a sticker

~65.38s
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)

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

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. 1
    POST /v2/face-to-sticker

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • 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.

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