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 const axios = require('axios'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/sdxl1.0-realvis-lightning"; const data = { "prompt": "mountains, snow, fog, volumetric, closeup portrait photo of young woman in dark clothes, perfect detailed eyes, natural skin, film grain, kayrissnovem, grey eyes", "negative_prompt": "(worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), open mouth", "samples": 1, "scheduler": "DPM++ SDE", "num_inference_steps": 8, "guidance_scale": 1, "seed": 968875, "img_width": 1024, "img_height": 1024, "base64": false }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
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


promptstr *

Prompt to render


negative_promptstr ( default: None )

(octane render, render, drawing, anime, bad photo, bad photography:1.3), (worst quality, low quality, blurry:1.2), (bad teeth, deformed teeth, deformed lips), (bad anatomy, bad proportions:1.1), (deformed iris, deformed pupils), (deformed eyes, bad eyes), (deformed face, ugly face, bad face), (deformed hands, bad hands, fused fingers), morbid, mutilated, mutation, disfigured


samplesint ( default: 1 ) Affects Pricing

Number of samples to generate.

min : 1,

max : 4


schedulerenum:str ( default: DPM++ SDE )

Type of scheduler.

Allowed values:


num_inference_stepsint ( default: 8 ) Affects Pricing

Number of denoising steps.

min : 1,

max : 100


guidance_scalefloat ( default: 1.4 )

Scale for classifier-free guidance

min : 1,

max : 25


seedint ( default: -1 )

Seed for image generation.

min : -1,

max : 999999999999999


img_widthenum:int ( default: 1024 ) Affects Pricing

Can only be 1024 for SDXL

Allowed values:


img_heightenum:int ( default: 1024 ) Affects Pricing

Can only be 1024 for SDXL

Allowed values:


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.

Realvis Lightning SDXL

The Realvis Lightning SDXL model is an advanced solution designed for swift and efficient generation of high-quality, photorealistic images. This model, an enhanced iteration of the Realvis XL, excels in delivering exceptional photorealistic images with remarkable speed. Its standout feature lies in its capacity to produce top-tier 1024px images rapidly, catering to applications that necessitate quick image generation.

To maximize the Realvis Lightning SDXL model's performance, it is crucial to ensure compatibility with the DPM++ SDE Karras / DPM++ SDE sampler. Optimal utilization involves employing 4-6 sampling steps and a CFG Scale of 1-2. These specific settings are key to achieving an effective and efficient image generation process, enabling users to fully leverage the capabilities of this sophisticated model.