Stability AI logoSDXL Lightning

A variant of Stable Diffusion XL that generates 1024x1024 px images in 4 UNet steps, enabling near real-time image creation.

Deploy SDXL Lightning behind an API endpoint in seconds.

Deploy model

SDXL Lightning is an implementation of Stable Diffusion XL that generates images in 1 to 8 UNet inference steps using a combination of techniques from latent consistency models, progressive distillation, and adversarial distillation to create high-quality images quickly.

SDXL Lightning has several advantages over other SDXL implementations:

  • While the base SDXL model requires 20-50 UNet inference steps for high-quality images, SDXL Lightning only requires 1 to 8 steps.

  • While SDXL Turbo creates images at 512x512 pixels, SDXL Lighting creates images at a full 1024x1024 pixel resolution.

  • SDXL Lighting offers higher output quality and closer prompt adherence than SDXL Turbo and other LCM implementations.

SDXL Lightning was created by researchers at ByteDance and you can learn more about the model from its paper and model card.

Do SDXL Lightning images look good?

SDXL Lightning offers substantially higher image quality than other fast models like SDXL Turbo.

Prompt: A rhino wearing a suit

How many inference steps does SDXL Lighting take?

SDXL Lightning can run for 1, 2, 4, or 8 inference steps. Inference steps refer to how many times the main UNet model is run, which takes the majority of inference time.

Our implementation uses the 4-step UNet, which provides a balance between speed and quality. You can deploy your own version with either 2 steps for even faster results on 8 steps for even higher quality. One-step inference is experimental and doesn’t always yield usable results.

What GPU is required for SDXL Lightning?

The model weights file for SDXL Lighting is 5.14 or 6.94 GB, depending on the variant, so you can run it on as small as a T4 GPU. However, you’ll achieve much higher performance on a larger A100 or H100 GPU.

By default, our implementation uses one A100 GPU for extremely fast inference.

How fast is SDXL Lightning?

We’re still working on exact benchmarks, but generation times are well under a second for a 4-step UNet on an A100 GPU.

Deploy any model in just a few commands

Avoid getting tangled in complex deployment processes. Deploy best-in-class open-source models and take advantage of optimized serving for your own models.

$

truss init -- example stable-diffusion-2-1-base ./my-sd-truss

$

cd ./my-sd-truss

$

export BASETEN_API_KEY=MdNmOCXc.YBtEZD0WFOYKso2A6NEQkRqTe

$

truss push

INFO

Serializing Stable Diffusion 2.1 truss.

INFO

Making contact with Baseten 👋 👽

INFO

🚀 Uploading model to Baseten 🚀

Upload progress: 0% | | 0.00G/2.39G