Skip to main content
Browse Models

ByteDance

SDXL Lightning

Released

2024-02-21

Family

Stable Diffusion XL

Type

Fine-Tuned Model

Downloads

External Download

You are about to open a link to an external source. Verify the URL before continuing.

Download

4-Step Model

FP16 · sdxl_lightning_4step.safetensors

1-Step Model

FP16 · sdxl_lightning_1step_x0.safetensors

2-Step Model

FP16 · sdxl_lightning_2step.safetensors

8-Step Model

FP16 · sdxl_lightning_8step.safetensors

Model Report

Overview

SDXL-Lightning is an open-source generative AI model developed by ByteDance for text-to-image synthesis. As an efficient distillation of Stable Diffusion XL, SDXL-Lightning leverages a progressive adversarial diffusion distillation process to enable rapid, high-resolution image generation—up to 1024×1024 pixels—with as few as one inference step. The model’s release includes both LoRA (Low-Rank Adaptation) and full UNet weights, offering options for integration.

Grid of diverse, high-quality SDXL-Lightning sample outputs

Figure 1. Eight distinct, high-resolution images generated by SDXL-Lightning, highlighting the model's versatility in subject matter and visual style based on text prompts.

Model Architecture and Training Methods

SDXL-Lightning is distilled from the SDXL Base 1.0 model, inheriting its latent diffusion framework and underlying UNet architecture. By operating in a compact latent space with a Variational Autoencoder (VAE), the model can efficiently encode and reconstruct high-resolution images while maintaining fidelity and diversity.

The progressive adversarial diffusion distillation method is a core component of SDXL-Lightning's design. Initially, the model is distilled using mean squared error (MSE) loss across many timesteps to ensure mode coverage. In subsequent stages, a discriminator—built upon the pre-trained SDXL UNet encoder and operating in latent space—enables adversarial training, enhancing realism and detail while reducing the inference step count. The process alternates between a conditional objective to preserve the generative path of the teacher model and an unconditional one to prioritize semantic correctness and reduce artifacts, such as erroneous feature blending.

This training protocol supports both LoRA and full UNet adaptations. LoRA checkpoints enable lightweight integration with other SDXL-based systems, while full UNet checkpoints maximize generation quality.

Technical Capabilities and Performance

SDXL-Lightning generates photorealistic images at 1024×1024 resolution in as few as 1, 2, 4, or 8 diffusion steps, compared to the dozens typically required by conventional diffusion models. This efficiency is achieved without substantial reduction in image fidelity or text alignment, supported by both quantitative and qualitative benchmarks in the official research paper.

Quantitative evaluations indicate that SDXL-Lightning demonstrates competitive performance compared to other open-source fast distillation models, such as SDXL-Turbo and LCM, in critical areas:

  • Fréchet Inception Distance (FID) for overall quality: SDXL-Lightning exhibits competitive FID-Whole values and favorable FID-Patch metrics that assess fine detail.
  • CLIP score for prompt-image alignment: The model maintains robust text-image correspondence across step counts.
  • Resolution and speed: Unlike SDXL-Turbo, which is limited to 512px outputs, SDXL-Lightning supports full 1024px generations while delivering images rapidly via fewer inference steps.

The architecture supports both classifier-free guidance (CFG) and unconditional generation. The model also demonstrates compatibility with ControlNet-like conditional guidance, allowing for user-driven constraints such as structural overlays (e.g., edges or depth maps), although minor degradation may occur under extreme fast-generation settings.

ComfyUI node-based workflow diagram for SDXL-Lightning 4-step

Figure 2. A complete ComfyUI workflow for SDXL-Lightning 4-step generation, including loading checkpoints, setting prompts, sampling, and the resulting high-resolution output for the prompt: 'A girl smiling'.

Training Datasets and Methodology

SDXL-Lightning’s distillation process utilizes large, high-quality datasets for data diversity and semantic richness. Images were selected from subsets of the LAION and COYO datasets, focusing on resolutions exceeding 1024px. To further refine the training corpus, LAION images were filtered for high aesthetic scores using an automated metric and for sharpness via a Laplacian filter; text prompt data were cleaned to ensure prompt-image alignment.

The training regime unfolds in multiple stages:

  • Initial MSE distillation reduces the teacher model’s inference steps from 128 to 32, with classifier-free guidance applied.
  • Progressive adversarial distillation then further reduces step count (32 → 8 → 4 → 2 → 1), alternating between conditional training for strict mode coverage and unconditional fine-tuning for improved semantic accuracy.
  • Both LoRA and full UNet models are trained at each stage, the former then merged for continued training to maximize compatibility.

The model demonstrates stability across timesteps, which is achieved partly by training on a mixture of noise levels and by tailoring architectural choices—such as switching from epsilon- to x0-prediction for the one-step variant—to reduce artifacts in extreme rapid-generation settings.

ComfyUI workflow for SDXL-Lightning 4-step LoRA

Figure 3. A ComfyUI workflow for generating an image with SDXL-Lightning 4-step LoRA. The diagram details how SDXL-Lightning can be integrated via LoRA, with the prompt 'A girl smiling', demonstrating the resulting image.

Deployment, Integration, and Use Cases

SDXL-Lightning's flexibility supports different deployment scenarios. Full UNet checkpoints enable high-fidelity synthesis, while LoRA weights provide efficient, low-overhead upgrades to compatible SDXL models—preserving stylistic and structural features while improving generation speed. This structure enables SDXL-Lightning to be used for both direct production of photorealistic images and as an accelerator within existing creative and editing pipelines.

The model’s rapid inference supports interactive, real-time, or high-throughput workflows where immediate feedback is crucial. Compatibility with conditional generative tools—such as ControlNet-driven tasks—broadens its applicability into areas like compositional editing, controlled augmentation, or context-aware image creation.

SDXL-Lightning’s robustness to aspect ratio variation, while trained primarily on square formats, enables generalization to a variety of output shapes, though minor quality trade-offs may appear in extreme one- or two-step, non-square generations.

Experimental SDXL-Lightning 1-step full checkpoint workflow

Figure 4. ComfyUI workflow for SDXL-Lightning's experimental 1-step full UNet variant, illustrating generation of 'A girl smiling' in a single inference step.

Limitations

While SDXL-Lightning advances rapid, high-fidelity image synthesis, it also presents certain constraints. Separate model checkpoints are required for each inference step setting, in contrast to models that support dynamic step counts from a single checkpoint. Quality may degrade for non-square aspect ratios or for extreme few-step generations, particularly at one step, where the architecture’s reliance on the decoder increases. Additionally, LoRA versions are currently unavailable for the one-step variant due to the substantial architectural modifications needed. A trade-off exists in balancing strict mode coverage with semantic correctness, meaning some rare, highly specific features present in the original teacher distribution may be deprioritized for overall image accuracy.

Licensing and Availability

SDXL-Lightning is released as an open-source research model, with checkpoints, code, and documentation available under its official repositories. Its LoRA and full model weights facilitate integration into a range of diffusion model-based applications and research environments.

Helpful Resources

About Stable Diffusion XL: The SDXL family of AI models represents a significant technological advancement in text-to-image generation, featuring a substantial increase in parameters—3.5 billion for the base model and 6.6 billion for the ensemble—alongside a dual-stage architecture that includes a base model and a refiner, enabling the creation of high-resolution (1024x1024) images with enhanced detail, color accuracy, and style versatility.

More in the Stable Diffusion XL Family

stabilityai /

Stable Diffusion XL

A text-to-image diffusion model with 3.5 billion parameters utilizing a two-stage generation pipeline for enhanced image quality and prompt adherence.
stabilityai /

SDXL Turbo

SDXL variant using the Adversarial Diffusion Distillation (ADD) technique to generate images very quickly, only requiring 2-6 steps instead of 20-60.
dataautogpt3 /

OpenDalle

SDXL model focused on prompt adherence and semantic understanding, with a stated aim of achieving Dalle-3 level understanding of prompts.
Yamer /

Yamer's Realistic

SDXL fine-tune capable of generating realistic images of people and landscapes.
albedobond /

AlbedoBase XL

SDXL fine-tune resulting from merging 300+ top community models, strong performance across a wide range of image types.
KandooAI /

Juggernaut XL

A popular versatile model finetuned on SDXL by KandooAI and RunDiffusion. This version features improved prompt adherence due to an innovative GPT-4 captioning system built by LEOSAM.
SG_161222 /

Realistic Vision XL

SDXL fine-tune optimizing for generating photorealistic people, animals, and landscapes. In addition to training, this model is a merge of over 10 other SDXL models aimed at realism.
ALIENHAZE /

New Reality XL

Merge of multiple SDXL checkpoints and LoRAs, with impressive breadth and consistency in generating photorealistic images.
razzz /

Realism Engine SDXL

SDXL checkpoint optimized for photorealistic generation of a wide range of humans.
CagliostroLab /

Animagine XL

SDXL fine-tune with very strong performance in genearating anime images.
SoCalGuitarist /

Nightvision XL

Photography-focused SDXL checkpoint with strong prompt adherence and versatile output.
Lykon /

Dreamshaper XL

Fine-Tuned on SDXL, this is a general purpose model designed for photos, art, anime, and manga. This Lightning version can generate quality images in few steps.
PurpleSmartAI /

Pony Diffusion V6 XL

A fine-tuned Stable Diffusion XL model trained on 2.6 million images for generating cartoon, anime, and anthropomorphic character art.
diffusers /

ControlNet SDXL Diffusers Canny

SDXL ControlNet model for edge detection.
stabilityai /

ControlNet SDXL Canny

Smaller SDXL ControlNet model for edge detection.
diffusers /

ControlNet SDXL Diffusers Depth

SDXL ControlNet model for depth generation.
stabilityai /

ControlNet SDXL Depth

Smaller SDXL ControlNet model for depth generation.
stabilityai /

ControlNet SDXL Recolor

SDXL ControlNet model for recoloring images.
h94 /

ControlNet SDXL IP Adapter

SDXL ControlNet model for conditioning on an image prompt.
thibaud /

ControlNet SDXL Open Pose

SDXL ControlNet model for copying human poses.