Omni Zero

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

~149.45s
~$0.174
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/omni-zero"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "seed": 42,
12    "prompt": "A person",
13    "base_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg",
14    "style_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-style.jpg",
15    "guidance_scale": 3,
16    "identity_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-identity.jpg",
17    "negative_prompt": "blurry, out of focus",
18    "number_of_steps": 10,
19    "number_of_images": 1,
20    "composition_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg",
21    "depth_image": "sample text",
22    "base_image_strength": 0.15,
23    "depth_image_strength": 0.5,
24    "style_image_strength": 1,
25    "identity_image_strength": 1,
26    "composition_image_strength": 1
27}
28
29response = requests.post(url, headers=headers, json=data)
30
31if response.status_code == 200:
32    result = response.json()
33    print(json.dumps(result, indent=2))
34else:
35    print(f"Error: {response.status_code}")
36    print(response.text)

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

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