Omni Zero Serverless API
Omni-Zero: A diffusion pipeline for zero-shot stylized portrait creation.
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) 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
https://api.segmind.com/v1/omni-zeroParameters
identity_imagerequiredstring (uri)Identity image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-identity.jpg"style_imagerequiredstring (uri)Style image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-style.jpg"base_imageoptionalstring (uri)Base image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg"base_image_strengthoptionalnumberBase image strength for the model
0.15Range: 0 - 1composition_imageoptionalstring (uri)Composition image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg"composition_image_strengthoptionalnumberComposition image strength for the model
1Range: 0 - 1depth_imageoptionalstring (uri)Depth image for the model
nulldepth_image_strengthoptionalnumberDepth image strength for the model, if not supplied the composition image will be used for depth
0.5Range: 0 - 1guidance_scaleoptionalnumberGuidance scale for the model
3Range: 0 - 14identity_image_strengthoptionalnumberIdentity image strength for the model
1Range: 0 - 1negative_promptoptionalstringNegative prompt for the model
"blurry, out of focus"number_of_imagesoptionalintegerNumber of images to generate
1Range: 1 - 4number_of_stepsoptionalintegerNumber of steps for the model
10Range: 1 - 50promptoptionalstringPrompt for the model
"A person"seedoptionalintegerRandom seed for the model
42style_image_strengthoptionalnumberStyle image strength for the model
1Range: 0 - 1Response 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/omni-zeroSubmit — 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