Skip to main content

SDXL - Lightning Models

SDXL-Lightning is a lightning-fast text-to-image generation model. It can generate high-quality 1024px images in a few steps. Inference times are faster than regular sdxl models.

ImagePipeline-Get

{
"model_id": "lightning",
"scheduler": "EulerDiscreteScheduler", //or DDIMScheduler
"guidance_scale": 1,
"num_inference_steps": 10,
"seed": -1,
"width": 1024,
"height": 1024,
"prompt": "a young girl smiling, curly hair, green eyes, photo, highly detailed",
"samples": 2,
"negative_prompt": ""
}
Lightning sdxl model image pipeline

JSON Parameters

ParameterPermissible valuesNotes
model_idstrmodel_id can be found in models page. Lightning models have the word Lightning in them.
promptstr, 75 tokensCheck our Prompt Guide for tips
negative_promptstr, 75 tokensCheck our Prompt Guide for tips
num_inference_stepsint, [1-100]Lightning models provide best results with just 6-12 steps Ideal value 6-12
strengthfloat, [0-1]Optional denoise strength
samplesint, [1-4]Generates a maximum of 4 samples per API call
guidance_scalefloat, [1-20]Lightning models give best results at low guidance scale values. Ideal value 0.5-2.
widthintWidth in pixels. Lower than or equal to 1024 for best results
heightintHeight in pixels. Lower than or equal to 1024 for best results
seedintControlling the seed can help you generate reproducible images
safety_checkerbooleanChecks for NSFW images and filters explicit images

Status

Your response will include a status.

  • If the status = SUCCESS, you will also have download_urls that will have the links to your generated image based on the number of samples you have entered. The maximum number of samples that can be generated is 4.
  • If the status = PENDING, you will receive a id. You can use the status endpoint to fetch your image using the id.
  • If the status = FAILURE, you will receive only an error message.

Endpoint:

  • https://api.imagepipeline.io/sdxl/text2image/v1/status/{{id}}

Pass the API-Key as the authorization in the header.