Omni Zero Serverless API

Omni-Zero: A diffusion pipeline for zero-shot stylized portrait creation.

~149.02s
POST /v2/omni-zero · 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    "omni-zero",
 9    seed=42,
10    prompt="A person",
11    base_image="https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg",
12    style_image="https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-style.jpg",
13    guidance_scale=3,
14    identity_image="https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-identity.jpg",
15    negative_prompt="blurry, out of focus",
16    number_of_steps=10,
17    number_of_images=1,
18    composition_image="https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg",
19    base_image_strength=0.15,
20    depth_image_strength=0.5,
21    style_image_strength=1,
22    identity_image_strength=1,
23    composition_image_strength=1,
24)
25print(result["status"])                      # COMPLETED
26print(result.get("output"))                  # model output (e.g. media URL)
27print(result["metrics"]["inference_time"])   # server compute seconds
28
29# --- Or submit + poll manually (track request_id, control the cadence) ---
30from segmind import SegmindClient, InferenceFailed, InferenceTimeout
31
32client = SegmindClient()                      # reads SEGMIND_API_KEY
33payload = {
34    "seed": 42,
35    "prompt": "A person",
36    "base_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg",
37    "style_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-style.jpg",
38    "guidance_scale": 3,
39    "identity_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-identity.jpg",
40    "negative_prompt": "blurry, out of focus",
41    "number_of_steps": 10,
42    "number_of_images": 1,
43    "composition_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg",
44    "base_image_strength": 0.15,
45    "depth_image_strength": 0.5,
46    "style_image_strength": 1,
47    "identity_image_strength": 1,
48    "composition_image_strength": 1,
49}
50job = client.submit_async("omni-zero", **payload)
51print(job.request_id)                         # available immediately
52try:
53    result = job.wait(timeout=600, interval=1.0)
54except InferenceTimeout as e:
55    print("still running:", e.request_id)
56except InferenceFailed as e:
57    print("failed:", e.detail)

API Endpoint

POSThttps://api.segmind.com/v1/omni-zero

Parameters

identity_imagerequired
string (uri)

Identity image for the model

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-identity.jpg"
style_imagerequired
string (uri)

Style image for the model

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-style.jpg"
base_imageoptional
string (uri)

Base image for the model

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg"
base_image_strengthoptional
number

Base image strength for the model

Default: 0.15Range: 0 - 1
composition_imageoptional
string (uri)

Composition image for the model

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg"
composition_image_strengthoptional
number

Composition image strength for the model

Default: 1Range: 0 - 1
depth_imageoptional
string (uri)

Depth image for the model

Default: null
depth_image_strengthoptional
number

Depth image strength for the model, if not supplied the composition image will be used for depth

Default: 0.5Range: 0 - 1
guidance_scaleoptional
number

Guidance scale for the model

Default: 3Range: 0 - 14
identity_image_strengthoptional
number

Identity image strength for the model

Default: 1Range: 0 - 1
negative_promptoptional
string

Negative prompt for the model

Default: "blurry, out of focus"
number_of_imagesoptional
integer

Number of images to generate

Default: 1Range: 1 - 4
number_of_stepsoptional
integer

Number of steps for the model

Default: 10Range: 1 - 50
promptoptional
string

Prompt for the model

Default: "A person"
seedoptional
integer

Random seed for the model

Default: 42
style_image_strengthoptional
number

Style image strength for the model

Default: 1Range: 0 - 1

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/omni-zero

    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