POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 const axios = require('axios'); const FormData = require('form-data'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/omni-zero"; const reqBody = { "seed": 42, "prompt": "A person", "base_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg", "style_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-style.jpg", "guidance_scale": 3, "identity_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-identity.jpg", "negative_prompt": "blurry, out of focus", "number_of_steps": 10, "number_of_images": 1, "composition_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg", "base_image_strength": 0.15, "depth_image_strength": 0.5, "style_image_strength": 1, "identity_image_strength": 1, "composition_image_strength": 1 }; (async function() { try { const formData = new FormData(); // Append regular fields for (const key in reqBody) { if (reqBody.hasOwnProperty(key)) { formData.append(key, reqBody[key]); } } // Convert and append images as Base64 if necessary const response = await axios.post(url, formData, { headers: { 'x-api-key': api_key, ...formData.getHeaders() } }); console.log(response.data); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


seedint ( default: 42 )

Random seed for the model


promptstr ( default: A person )

Prompt for the model


base_imagestr ( default: https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg )

Base image for the model


style_imagestr *

Style image for the model


guidance_scalefloat ( default: 3 )

Guidance scale for the model

min : 0,

max : 14


identity_imagestr *

Identity image for the model


negative_promptstr ( default: blurry, out of focus )

Negative prompt for the model


number_of_stepsint ( default: 10 )

Number of steps for the model

min : 1,

max : 50


number_of_imagesint ( default: 1 )

Number of images to generate

min : 1,

max : 4


composition_imagestr ( default: https://segmind-sd-models.s3.amazonaws.com/display_images/omni-zero-base.jpg )

Composition image for the model


depth_imagestr ( default: 1 )

Depth image for the model


base_image_strengthfloat ( default: 0.15 )

Base image strength for the model

min : 0,

max : 1


depth_image_strengthfloat ( default: 0.5 )

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

min : 0,

max : 1


style_image_strengthfloat ( default: 1 )

Style image strength for the model

min : 0,

max : 1


identity_image_strengthfloat ( default: 1 )

Identity image strength for the model

min : 0,

max : 1


composition_image_strengthfloat ( default: 1 )

Composition image strength for the model

min : 0,

max : 1

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Omni Zero

Omni Zero is a powerful tool designed to create stylized portraits with zero-shot learning. Combining composition, style and identity images, Omni Zero can transform ordinary images into captivating artworks. Here are the key features:

  • Zero-Shot Composition: Omni Zero requires just one image to set the structure and the scene of the output image and does not require any training at all.

  • Zero-Shot Stylization: Omni Zero requires no training data or specific style examples. It adapts to any input image, making it ideal for artists, designers, and photographers.

  • Single Identity and Style: Omni Zero seamlessly integrates identity and style, allowing you to maintain the subject’s likeness while adding artistic flair to the image.

  • Multiple Identities and Styles (Work in Progress): Future updates will enable multi-identity and multi-style transformations, expanding creative possibilities.