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);
}
})();
Random seed for the model
Prompt for the model
Base image for the model
Style image for the model
Guidance scale for the model
min : 0,
max : 14
Identity image for the model
Negative prompt for the model
Number of steps for the model
min : 1,
max : 50
Number of images to generate
min : 1,
max : 4
Composition image for the model
Depth image for the model
Base image strength for the model
min : 0,
max : 1
Depth image strength for the model, if not supplied the composition image will be used for depth
min : 0,
max : 1
Style image strength for the model
min : 0,
max : 1
Identity image strength for the model
min : 0,
max : 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 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.