Consistent Character Serverless API

Create images of a given character in different poses

~61.31s
POST /v2/consistent-character · 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    "consistent-character",
 9    seed=42,
10    prompt="a photo of a man at a beach, wearing hawaiian shirt, looking directly at the camera",
11    subject="https://segmind-sd-models.s3.amazonaws.com/display_images/consistant-character-ip.png",
12    output_format="webp",
13    output_quality=80,
14    negative_prompt="low quality,blur",
15    randomise_poses=True,
16    number_of_outputs=1,
17    number_of_images_per_pose=1,
18)
19print(result["status"])                      # COMPLETED
20print(result.get("output"))                  # model output (e.g. media URL)
21print(result["metrics"]["inference_time"])   # server compute seconds
22
23# --- Or submit + poll manually (track request_id, control the cadence) ---
24from segmind import SegmindClient, InferenceFailed, InferenceTimeout
25
26client = SegmindClient()                      # reads SEGMIND_API_KEY
27payload = {
28    "seed": 42,
29    "prompt": "a photo of a man at a beach, wearing hawaiian shirt, looking directly at the camera",
30    "subject": "https://segmind-sd-models.s3.amazonaws.com/display_images/consistant-character-ip.png",
31    "output_format": "webp",
32    "output_quality": 80,
33    "negative_prompt": "low quality,blur",
34    "randomise_poses": True,
35    "number_of_outputs": 1,
36    "number_of_images_per_pose": 1,
37}
38job = client.submit_async("consistent-character", **payload)
39print(job.request_id)                         # available immediately
40try:
41    result = job.wait(timeout=600, interval=1.0)
42except InferenceTimeout as e:
43    print("still running:", e.request_id)
44except InferenceFailed as e:
45    print("failed:", e.detail)

API Endpoint

POSThttps://api.segmind.com/v1/consistent-character

Parameters

negative_promptoptional
string

Things you do not want to see in your image

Default: "low quality,blur"
number_of_images_per_poseoptional
integer

The number of images to generate for each pose.

Default: 1Range: 1 - 4
number_of_outputsoptional
integer

The number of images to generate.

Default: 1Range: 1 - 20
output_formatoptional
string

An enumeration.

Default: "webp"
Allowed values :
"webp""jpg""png"
output_qualityoptional
integer

Quality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality.

Default: 80Range: 0 - 100
promptoptional
string

Describe the subject. Include clothes and hairstyle for more consistency.

Default: "a photo of a man at a beach, wearing hawaiian shirt, looking directly at the camera"
randomise_posesoptional
boolean

Randomise the poses used.

Default: true
seedoptional
integer

Set a seed for reproducibility. Random by default.

Default: 42
subjectoptional
string (uri)

An image of a person. Best images are square close ups of a face, but they do not have to be.

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/consistant-character-ip.png"

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/consistent-character

    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