POST/v1/kandinsky2.2-txt2img
1const axios = require('axios');
2
3
4const api_key = "YOUR API-KEY";
5const url = "https://api.segmind.com/v1/kandinsky2.2-txt2img";
6
7const data = {
8  "prompt": "masterpiece, best quality, portrait of an old man, 50mm, solo, natural skin texture, realistic eye and face details, dark, deep shadow, darkness, moonlight, award winning photo, extremely detailed, fine detail, highly detailed, extremely detailed eyes and face, piercing red eyes, detailed clothes, skinny, gothic, native american clothing, analog film, stock photograph,",
9  "negative_prompt": "lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands",
10  "samples": 1,
11  "num_inference_steps": 25,
12  "img_width": 512,
13  "img_height": 768,
14  "prior_steps": 25,
15  "seed": 9863172,
16  "base64": false
17};
18
19(async function() {
20    try {
21        const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
22        console.log(response.data);
23    } catch (error) {
24        console.error('Error:', error.response.data);
25    }
26})();
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
Expand

Attributes


promptstr *

Prompt to render


negative_promptstr ( default: None )

Prompts to exclude, eg. 'bad anatomy, bad hands, missing fingers'


samplesint ( default: 1 ) Affects Pricing

Number of samples to generate.

min : 1,

min : 4


num_inference_stepsint ( default: 20 ) Affects Pricing

Number of denoising steps.

min : 20,

min : 100


img_widthenum:int ( default: 768 ) Affects Pricing

Image resolution.

Allowed values:


img_heightenum:int ( default: 768 ) Affects Pricing

Image resolution.

Allowed values:


prior_stepsint ( default: 25 )

Number of denoising steps.

min : 1,

min : 100


seedint ( default: -1 )

Seed for image generation.


base64boolean ( default: 1 )

Base64 encoding of the output image.

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.

Kandinsky 2.2

Kandinsky 2.2, a groundbreaking advancement over its predecessor, Kandinsky 2.1. With the integration of the powerful CLIP-ViT-G image encoder and the innovative ControlNet support, Kandinsky 2.2 is set to redefine the boundaries of aesthetic image creation and text comprehension.

At the heart of Kandinsky 2.2 lies the state-of-the-art CLIP-ViT-G image encoder, a transformative addition that amplifies the model's ability to craft visually stunning images while enhancing its text understanding capabilities. Complementing this is the ControlNet mechanism, a strategic inclusion designed to offer users unparalleled control over the image generation process.

Advantages

  1. Enhanced Image Aesthetics: The CLIP-ViT-G encoder ensures the generation of visually richer and more captivating images.

  2. Superior Text Understanding: With the new encoder, the model boasts an improved comprehension of text, bridging the gap between textual prompts and visual outputs.

  3. Precision Control: The ControlNet support empowers users to guide the image generation process, ensuring outputs that align with their vision.

  4. Optimized Performance: The combined power of CLIP-ViT-G and ControlNet results in a significant boost in the model's overall performance.

Use Cases

  1. Digital Art Creation: Artists can harness Kandinsky 2.2 to craft digital artworks that resonate with depth and detail.

  2. Content Generation: Ideal for content creators seeking to generate visuals based on textual prompts or narratives.

  3. Interactive Design: Designers can iteratively shape their designs, making real-time adjustments guided by text.

  4. Educational Tools: Can be integrated into learning platforms, allowing students to explore the interplay between text and visuals.

  5. Gaming and AR: Enhance user immersion in games or AR experiences by generating visuals based on in-game narratives or user prompts.

Kandinsky 2.2 License

Kandinsky 2.2's permissive license ensures that users, be they individual creators, businesses, or developers, can utilize the model for a myriad of commercial purposes without the constraints typically associated with restrictive licenses.