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 "base_image_strength": 0.15,
22 "depth_image_strength": 0.5,
23 "style_image_strength": 1,
24 "identity_image_strength": 1,
25 "composition_image_strength": 1
26}
27
28response = requests.post(url, headers=headers, json=data)
29
30if response.status_code == 200:
31 result = response.json()
32 print(json.dumps(result, indent=2))
33else:
34 print(f"Error: {response.status_code}")
35 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 "base_image_strength": 0.15,
22 "depth_image_strength": 0.5,
23 "style_image_strength": 1,
24 "identity_image_strength": 1,
25 "composition_image_strength": 1
26}
27
28response = requests.post(url, headers=headers, json=data)
29
30if response.status_code == 200:
31 result = response.json()
32 print(json.dumps(result, indent=2))
33else:
34 print(f"Error: {response.status_code}")
35 print(response.text)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
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