POST/v1/ip-sdxl-depth
1const axios = require('axios');
2
3const fs = require('fs');
4const path = require('path');
5
6async function toB64(imgPath) {
7    const data = fs.readFileSync(path.resolve(imgPath));
8    return Buffer.from(data).toString('base64');
9}
10
11const api_key = "YOUR API-KEY";
12const url = "https://api.segmind.com/v1/ip-sdxl-depth";
13
14const data = {
15  "prompt": "living room",
16  "negative_prompt": "lowquality, badquality, sketches",
17  "samples": 1,
18  "scheduler": "Euler a",
19  "num_inference_steps": 25,
20  "guidance_scale": 7,
21  "seed": 56433128,
22  "controlnet_scale": 0.5,
23  "ip_adapter_scale": 0.5,
24  "strength": 0.9,
25  "base64": false,
26  "input_image": "toB64('https://segmind-sd-models.s3.amazonaws.com/outputs/depth_img_input.jpg')",
27  "ip_image": "toB64('https://segmind-sd-models.s3.amazonaws.com/outputs/depth_ip_input.jpg')"
28};
29
30(async function() {
31    try {
32        const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
33        console.log(response.data);
34    } catch (error) {
35        console.error('Error:', error.response.data);
36    }
37})();
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


schedulerenum:str ( default: DPM2 Karras )

Type of scheduler.

Allowed values:


num_inference_stepsint ( default: 25 ) Affects Pricing

Number of denoising steps.

min : 20,

min : 100


guidance_scalefloat ( default: 7.5 )

Scale for classifier-free guidance

min : 1,

min : 25


seedint ( default: -1 )

Seed for image generation.

min : -1,

min : 999999999999999


controlnet_scalefloat ( default: 7.5 )

Scale for classifier-free guidance

min : 0,

min : 1


ip_adapter_scalefloat ( default: 7.5 )

Scale for classifier-free guidance

min : 0,

min : 1


strengthfloat ( default: 0.99 )

Scale for classifier-free guidance

min : 0,

min : 1


base64boolean ( default: 1 )

Base64 encoding of the output image.


input_imageimage *

Input Image


ip_imageimage *

Ip 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.

IP Adapter XL Depth is a groundbreaking AI model that revolutionizes the way we approach image generation. By integrating the IP Adapter with the Depth Preprocessor, this model significantly enhances the functionality of the SDXL framework, offering a unique blend of depth perception and contextual understanding in image creation.

At the core of IP Adapter XL Depth is the innovative combination of two powerful tools. The IP Adapter allows the SDXL model to effectively utilize image prompts alongside text prompts, while the Depth Preprocessor analyzes and extracts depth cues from images. This synergy results in a model that not only generates detailed images but also understands and replicates the spatial dimensions of the original scene.

Key Features:

  1. Dual Prompt Integration : Seamlessly combines image and text prompts for intricate image transformations.

  2. Advanced Depth Perception:Utilizes the Depth Preprocessor to extract and interpret depth cues, adding a new dimension to images.

  3. Contextual Depth and Detail: Produces images that are not only detailed but also rich in contextual depth.

  4. Creative Versatility: Ideal for a wide range of applications, from digital art to scientific visualization.

Applications:

  1. Digital Art and Illustration: Create complex artworks that blend elements from different images and concepts.

  2. Architectural Visualization: Enhance architectural renderings with accurate depth perception and detailed textures.

  3. Photography Enhancement: Combine photographic elements with artistic prompts for unique compositions.

  4. Educational Tools: Teach advanced concepts in digital art and image processing.

  5. Personal Projects: Experiment with blending personal photos with creative text prompts for unique creations.