ByteDance / SDXL-Lightning

huggingface.co
Total runs: 88.3K
24-hour runs: -1.6K
7-day runs: -8.4K
30-day runs: -6.0K
Model's Last Updated: April 03 2024
text-to-image

Introduction of SDXL-Lightning

Model Details of SDXL-Lightning

SDXL-Lightning

Intro Image

SDXL-Lightning is a lightning-fast text-to-image generation model. It can generate high-quality 1024px images in a few steps. For more information, please refer to our research paper: SDXL-Lightning: Progressive Adversarial Diffusion Distillation . We open-source the model as part of the research.

Our models are distilled from stabilityai/stable-diffusion-xl-base-1.0 . This repository contains checkpoints for 1-step, 2-step, 4-step, and 8-step distilled models. The generation quality of our 2-step, 4-step, and 8-step model is amazing. Our 1-step model is more experimental.

We provide both full UNet and LoRA checkpoints. The full UNet models have the best quality while the LoRA models can be applied to other base models.

Demos
  • Generate with all configurations, best quality: Demo
Checkpoints
  • sdxl_lightning_Nstep.safetensors : All-in-one checkpoint, for ComfyUI.
  • sdxl_lightning_Nstep_unet.safetensors : UNet checkpoint only, for Diffusers.
  • sdxl_lightning_Nstep_lora.safetensors : LoRA checkpoint, for Diffusers and ComfyUI.
Diffusers Usage

Please always use the correct checkpoint for the corresponding inference steps.

2-Step, 4-Step, 8-Step UNet
import torch
from diffusers import StableDiffusionXLPipeline, UNet2DConditionModel, EulerDiscreteScheduler
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file

base = "stabilityai/stable-diffusion-xl-base-1.0"
repo = "ByteDance/SDXL-Lightning"
ckpt = "sdxl_lightning_4step_unet.safetensors" # Use the correct ckpt for your step setting!

# Load model.
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cuda", torch.float16)
unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cuda"))
pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda")

# Ensure sampler uses "trailing" timesteps.
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")

# Ensure using the same inference steps as the loaded model and CFG set to 0.
pipe("A girl smiling", num_inference_steps=4, guidance_scale=0).images[0].save("output.png")
2-Step, 4-Step, 8-Step LoRA

Use LoRA only if you are using non-SDXL base models. Otherwise use our UNet checkpoint for better quality.

import torch
from diffusers import StableDiffusionXLPipeline, EulerDiscreteScheduler
from huggingface_hub import hf_hub_download

base = "stabilityai/stable-diffusion-xl-base-1.0"
repo = "ByteDance/SDXL-Lightning"
ckpt = "sdxl_lightning_4step_lora.safetensors" # Use the correct ckpt for your step setting!

# Load model.
pipe = StableDiffusionXLPipeline.from_pretrained(base, torch_dtype=torch.float16, variant="fp16").to("cuda")
pipe.load_lora_weights(hf_hub_download(repo, ckpt))
pipe.fuse_lora()

# Ensure sampler uses "trailing" timesteps.
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")

# Ensure using the same inference steps as the loaded model and CFG set to 0.
pipe("A girl smiling", num_inference_steps=4, guidance_scale=0).images[0].save("output.png")
1-Step UNet

The 1-step model is only experimental and the quality is much less stable. Consider using the 2-step model for much better quality.

The 1-step model uses "sample" prediction instead of "epsilon" prediction! The scheduler needs to be configured correctly.

import torch
from diffusers import StableDiffusionXLPipeline, UNet2DConditionModel, EulerDiscreteScheduler
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file

base = "stabilityai/stable-diffusion-xl-base-1.0"
repo = "ByteDance/SDXL-Lightning"
ckpt = "sdxl_lightning_1step_unet_x0.safetensors" # Use the correct ckpt for your step setting!

# Load model.
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cuda", torch.float16)
unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cuda"))
pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16").to("cuda")

# Ensure sampler uses "trailing" timesteps and "sample" prediction type.
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", prediction_type="sample")

# Ensure using the same inference steps as the loaded model and CFG set to 0.
pipe("A girl smiling", num_inference_steps=1, guidance_scale=0).images[0].save("output.png")
ComfyUI Usage

Please always use the correct checkpoint for the corresponding inference steps. Please use Euler sampler with sgm_uniform scheduler.

2-Step, 4-Step, 8-Step Full
  1. Download the full checkpoint ( sdxl_lightning_Nstep.safetensors ) to /ComfyUI/models/checkpoints .
  2. Download our ComfyUI full workflow .

SDXL-Lightning ComfyUI Full Workflow

2-Step, 4-Step, 8-Step LoRA

Use LoRA only if you are using non-SDXL base models. Otherwise use our full checkpoint for better quality.

  1. Prepare your own base model.
  2. Download the LoRA checkpoint ( sdxl_lightning_Nstep_lora.safetensors ) to /ComfyUI/models/loras
  3. Download our ComfyUI LoRA workflow .

SDXL-Lightning ComfyUI LoRA Workflow

1-Step

The 1-step model is only experimental and the quality is much less stable. Consider using the 2-step model for much better quality.

  1. Update your ComfyUI to the latest version.
  2. Download the full checkpoint ( sdxl_lightning_1step_x0.safetensors ) to /ComfyUI/models/checkpoints .
  3. Download our ComfyUI full 1-step workflow .

SDXL-Lightning ComfyUI Full 1-Step Workflow

Cite Our Work
@misc{lin2024sdxllightning,
      title={SDXL-Lightning: Progressive Adversarial Diffusion Distillation}, 
      author={Shanchuan Lin and Anran Wang and Xiao Yang},
      year={2024},
      eprint={2402.13929},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Runs of ByteDance SDXL-Lightning on huggingface.co

88.3K
Total runs
-1.6K
24-hour runs
-4.0K
3-day runs
-8.4K
7-day runs
-6.0K
30-day runs

More Information About SDXL-Lightning huggingface.co Model

More SDXL-Lightning license Visit here:

https://choosealicense.com/licenses/openrail++

SDXL-Lightning huggingface.co

SDXL-Lightning huggingface.co is an AI model on huggingface.co that provides SDXL-Lightning's model effect (), which can be used instantly with this ByteDance SDXL-Lightning model. huggingface.co supports a free trial of the SDXL-Lightning model, and also provides paid use of the SDXL-Lightning. Support call SDXL-Lightning model through api, including Node.js, Python, http.

SDXL-Lightning huggingface.co Url

https://huggingface.co/ByteDance/SDXL-Lightning

ByteDance SDXL-Lightning online free

SDXL-Lightning huggingface.co is an online trial and call api platform, which integrates SDXL-Lightning's modeling effects, including api services, and provides a free online trial of SDXL-Lightning, you can try SDXL-Lightning online for free by clicking the link below.

ByteDance SDXL-Lightning online free url in huggingface.co:

https://huggingface.co/ByteDance/SDXL-Lightning

SDXL-Lightning install

SDXL-Lightning is an open source model from GitHub that offers a free installation service, and any user can find SDXL-Lightning on GitHub to install. At the same time, huggingface.co provides the effect of SDXL-Lightning install, users can directly use SDXL-Lightning installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

SDXL-Lightning install url in huggingface.co:

https://huggingface.co/ByteDance/SDXL-Lightning

Url of SDXL-Lightning

SDXL-Lightning huggingface.co Url

Provider of SDXL-Lightning huggingface.co

ByteDance
ORGANIZATIONS

Other API from ByteDance

huggingface.co

Total runs: 53.5K
Run Growth: 11.6K
Growth Rate: 21.64%
Updated:December 05 2024
huggingface.co

Total runs: 18.8K
Run Growth: -38.9K
Growth Rate: -206.40%
Updated:January 19 2026
huggingface.co

Total runs: 8.5K
Run Growth: 1.5K
Growth Rate: 17.87%
Updated:January 19 2026
huggingface.co

Total runs: 853
Run Growth: -27
Growth Rate: -3.17%
Updated:September 08 2025
huggingface.co

Total runs: 834
Run Growth: 309
Growth Rate: 37.05%
Updated:July 16 2025
huggingface.co

Total runs: 633
Run Growth: -313
Growth Rate: -49.45%
Updated:November 28 2025
huggingface.co

Total runs: 514
Run Growth: -9
Growth Rate: -1.75%
Updated:December 12 2025
huggingface.co

Total runs: 392
Run Growth: 97
Growth Rate: 24.74%
Updated:April 04 2025
huggingface.co

Total runs: 377
Run Growth: -212
Growth Rate: -56.23%
Updated:September 08 2025
huggingface.co

Total runs: 287
Run Growth: -115
Growth Rate: -40.07%
Updated:September 08 2025
huggingface.co

Total runs: 160
Run Growth: -456
Growth Rate: -285.00%
Updated:November 12 2025
huggingface.co

Total runs: 154
Run Growth: -65
Growth Rate: -42.21%
Updated:June 02 2026
huggingface.co

Total runs: 123
Run Growth: -177
Growth Rate: -143.90%
Updated:June 10 2026
huggingface.co

Total runs: 87
Run Growth: -61
Growth Rate: -70.11%
Updated:September 08 2025
huggingface.co

Total runs: 77
Run Growth: 70
Growth Rate: 90.91%
Updated:April 22 2025
huggingface.co

Total runs: 37
Run Growth: -27
Growth Rate: -72.97%
Updated:July 01 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:August 26 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:November 11 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 02 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:June 01 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 27 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 13 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 05 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:June 24 2025