To run SDXL-Lightning locally, pair ByteDance's downloaded checkpoint with its trained step count and the official settings for your interface. The supplied four-step ComfyUI workflow uses CFG 1, Euler, and sgm_uniform; the Diffusers recipe uses guidance scale 0 and trailing timesteps. SDXL-Lightning is a distilled SDXL text-to-image release with downloadable weights. Model card, ComfyUI workflow
What are the key facts about SDXL-Lightning?
| Field | Detail |
|---|---|
| Developer | ByteDance; researchers Shanchuan Lin, Anran Wang, and Xiao Yang. Model card, paper |
| Released | Research first submitted February 21, 2024. Paper history |
| Type | Progressive adversarial diffusion distillation of SDXL for text-to-image generation. Paper |
| Size or parameters | Parameter count not specified in the release card. Model card |
| License and access | Downloadable weights; the repository identifies its license as OpenRAIL++. Model card |
| Where it runs | Local or self-managed GPU inference using ComfyUI or Diffusers. Official usage instructions |
Which checkpoint formats does SDXL-Lightning provide?
The release provides checkpoints for one, two, four, and eight steps, targeting 1024-pixel image generation. It includes full UNet weights and LoRA weights, plus complete checkpoints for ComfyUI. Release contents
The research describes progressive distillation with an adversarial objective.
The benefit to evaluate is generation with fewer model evaluations; that does not by itself establish a fixed latency on a particular laptop or server. Research paper
This makes an explicit comparison workflow useful. Choose a small set of prompts representing your actual work, generate candidates with a documented configuration, and record whether the images meet the brief.
For example, use one product still life, one portrait, and one scene with several objects.
Decide in advance whether you care most about composition, small details, or exact placement. Avoid changing the evaluation criteria after seeing outputs.
ByteDance recommends its full UNet option for quality when using the original base, while the LoRA option supports applying the acceleration approach to other suitable base models.
Follow the compatibility guidance for your checkpoint. Release guidance
What are the limits of one-step SDXL-Lightning?
The one-step release is explicitly experimental and requires a different prediction configuration. ByteDance warns that its quality is less stable and suggests the two-step option as an alternative. One-step instructions
For a first setup, use the published four-step workflow. Keep the one-step configuration in a separate saved workflow so that its special settings do not leak into other experiments.
The Diffusers recipe still loads the SDXL base pipeline and replaces its UNet with the selected Lightning weights. Account for that full pipeline when preparing the inference environment. Release documentation
Measure image generation after the model is loaded, and record loading separately. Also note the image dimensions, batch size, and any additional stages. This produces a useful local measurement without generalizing it to other hardware.
If an image is poor, first check the selected filename and sampling settings. Changing the prompt before verifying the configuration can hide a setup mistake and make the comparison harder to interpret.
How do you run SDXL-Lightning in ComfyUI or Diffusers?
For ComfyUI, download the complete sdxl_lightning_4step.safetensors checkpoint into ComfyUI/models/checkpoints. Import ByteDance's full workflow and select that exact file in the loader. ComfyUI setup
The published graph uses a 1024×1024 latent, four steps, CFG 1, the Euler sampler, and the sgm_uniform scheduler. It connects the sampled latent through VAE decoding to an image-saving node. Official workflow JSON
Keep those settings for the first image. Use a plain descriptive prompt and save the graph when it works, then make a copy for experimentation. This gives you an identifiable configuration to return to.
For Python, ByteDance documents replacing SDXL's UNet with the four-step UNet file. The example below follows that loading pattern and assumes the required libraries and CUDA-enabled PyTorch are already installed. Diffusers example
import torch
from diffusers import StableDiffusionXLPipeline, UNet2DConditionModel
from diffusers import EulerDiscreteScheduler
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
base = "stabilityai/stable-diffusion-xl-base-1.0"
unet = UNet2DConditionModel.from_config(base, subfolder="unet")
unet = unet.to("cuda", torch.float16)
weights = hf_hub_download(
"ByteDance/SDXL-Lightning", "sdxl_lightning_4step_unet.safetensors"
)
unet.load_state_dict(load_file(weights, device="cuda"))
pipe = StableDiffusionXLPipeline.from_pretrained(
base, unet=unet, torch_dtype=torch.float16, variant="fp16"
).to("cuda")
pipe.scheduler = EulerDiscreteScheduler.from_config(
pipe.scheduler.config, timestep_spacing="trailing"
)
pipe("A ceramic teapot on a wooden table", num_inference_steps=4,
guidance_scale=0).images[0].save("lightning.png")
Notice the interface-specific values: the official Diffusers example uses guidance scale zero, while the ComfyUI graph uses CFG one. Copy the complete recipe for your interface instead of translating a single field by name. Example, graph
To test another supported step count, change both the checkpoint and the number of steps according to its instructions. Keep the prompt set and review criteria fixed so the comparison answers a clear question.
Write down the exact file, library or interface version, and settings next to your results. If a later run differs, those notes help distinguish a changed environment from a changed model or prompt.
The ComfyUI pillar covers graph organization. The LoRA guide helps with later adapter experiments.
How does SDXL-Lightning compare with SDXL Turbo?
| Model | Documented starting point | What to compare |
|---|---|---|
| SDXL-Lightning | Checkpoint matched to its step count; official four-step workflow available. ByteDance graph | Acceptance rate at the selected step count |
| SDXL Turbo | Distilled SDXL with guidance disabled and a preferred 512×512 starting size. Turbo documentation | Whether that output size meets the same brief |
Read the SDXL Turbo sibling guide before transferring settings between them. Keep dimensions and any later resizing visible in your comparison notes.
Community derivatives are another evaluation path. The CreaPrompt Lightning guide covers a creator's checkpoint with its own version-specific recommendations.
What else should you know about SDXL-Lightning?
Who developed SDXL-Lightning?
ByteDance released SDXL-Lightning using Stability AI's SDXL Base as the source model for distillation. The associated paper names Shanchuan Lin, Anran Wang, and Xiao Yang as its authors. Model card, paper
Can I use any step count with an SDXL-Lightning checkpoint?
SDXL-Lightning requires the inference step count to match the selected checkpoint. For example, sdxl_lightning_4step.safetensors belongs with the four-step ComfyUI recipe. Usage requirements, workflow
What CFG values does SDXL-Lightning use in ComfyUI and Diffusers?
The official SDXL-Lightning ComfyUI workflow uses CFG 1. ByteDance's Diffusers example uses guidance_scale=0 with trailing timesteps; follow the complete recipe for the selected interface. Graph, example
Should I start with one-step SDXL-Lightning?
ByteDance labels one-step SDXL-Lightning experimental and says its quality is less stable than the two-step model. Its Diffusers recipe also requires prediction_type="sample", so use the dedicated one-step instructions when testing it. One-step notes
Sources
- ByteDance SDXL-Lightning model card
- SDXL-Lightning research paper and submission history
- ByteDance full ComfyUI workflow
- Hugging Face SDXL Turbo pipeline documentation
Top comments (0)