Omni Zero
Omni-Zero: A diffusion pipeline for zero-shot stylized portrait creation.
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)
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
https://api.segmind.com/v1/omni-zero
Parameters
identity_image
requiredstring (uri)
Identity image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-identity.jpg"
style_image
requiredstring (uri)
Style image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-style.jpg"
base_image
optionalstring (uri)
Base image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg"
base_image_strength
optionalnumber
Base image strength for the model
0.15
Range: 0 - 1composition_image
optionalstring (uri)
Composition image for the model
"https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg"
composition_image_strength
optionalnumber
Composition image strength for the model
1
Range: 0 - 1depth_image
optionalstring (uri)
Depth image for the model
null
depth_image_strength
optionalnumber
Depth image strength for the model, if not supplied the composition image will be used for depth
0.5
Range: 0 - 1guidance_scale
optionalnumber
Guidance scale for the model
3
Range: 0 - 14identity_image_strength
optionalnumber
Identity image strength for the model
1
Range: 0 - 1negative_prompt
optionalstring
Negative prompt for the model
"blurry, out of focus"
number_of_images
optionalinteger
Number of images to generate
1
Range: 1 - 4number_of_steps
optionalinteger
Number of steps for the model
10
Range: 1 - 50prompt
optionalstring
Prompt for the model
"A person"
seed
optionalinteger
Random seed for the model
42
style_image_strength
optionalnumber
Style image strength for the model
1
Range: 0 - 1Response Type
Returns: Image
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