SDXL-Lightning is a lightning-fast text-to-image generation model that produces high-quality 1024px images in just a few steps, distilled from Stable Diffusion XL.
{
"error": "",
"inferenceTime": 1275,
"output": [
"https://media.modelrunner.ai/23XIA3bfuk6QhdkBRUxXf.png"
],
"input": {
"seed": 452312,
"width": 1024,
"height": 1024,
"prompt": "A futuristic cyberpunk cityscape at night with neon lights reflecting on wet pavement, cinematic lighting, highly detailed, 8k resolution, photorealistic",
"scheduler": "K_EULER",
"num_outputs": 1,
"guidance_scale": 0,
"negative_prompt": "blurry, low quality, bad anatomy, distorted, pixelated",
"num_inference_steps": 4,
"disable_safety_checker": false
},
"logs": "Using seed: 452312\nPrompt: A futuristic cyberpunk cityscape at night with neon lights reflecting on wet pavement, cinematic lighting, highly detailed, 8k resolution, photorealistic\n 0%| | 0/4 [00:00<?, ?it/s]\n 50%|█████ | 2/4 [00:00<00:00, 15.47it/s]\n100%|██████████| 4/4 [00:00<00:00, 15.36it/s]\n100%|██████████| 4/4 [00:00<00:00, 15.37it/s]\n"
}
Generated in 1.275 seconds
Logs (7 lines)
Model Example Requests
Examples
SDXL Lightning 4-step API
SDXL Lightning 4-step is a text-to-image AI model by bytedance. On ModelRunner it runs through a REST API or via MCP from any AI assistant, at about $0.00215033 per image.
POST https://queue.modelrunner.run/bytedance/sdxl-lightning-4step
cURL
# Submit a request to the queue. Input fields go at the top level of the
# body. The optional reserved "metadata" object holds your own flat string
# tags — stored on the request, never sent to the model; filter later with
# GET https://queue.modelrunner.run/requests?metadata=<url-encoded JSON>.
curl -X POST https://queue.modelrunner.run/bytedance/sdxl-lightning-4step \
-H "Authorization: Key $MRUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"seed": 452312,
"width": 1024,
"height": 1024,
"prompt": "A futuristic cyberpunk cityscape at night with neon lights reflecting on wet pavement, cinematic lighting, highly det…",
"scheduler": "K_EULER",
"num_outputs": 1,
"guidance_scale": 0,
"negative_prompt": "blurry, low quality, bad anatomy, distorted, pixelated",
"num_inference_steps": 4,
"disable_safety_checker": false,
"metadata": {
"project": "my-project"
}
}'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }
# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/bytedance/sdxl-lightning-4step/requests/$REQUEST_ID/status" \
-H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/bytedance/sdxl-lightning-4step/requests/$REQUEST_ID" \
-H "Authorization: Key $MRUN_API_KEY"
JavaScript
import { modelrunner } from "@modelrunner/client";
const result = await modelrunner.subscribe("bytedance/sdxl-lightning-4step", {
input: {
"seed": 452312,
"width": 1024,
"height": 1024,
"prompt": "A futuristic cyberpunk cityscape at night with neon lights reflecting on wet pavement, cinematic lighting, highly det…",
"scheduler": "K_EULER",
"num_outputs": 1,
"guidance_scale": 0,
"negative_prompt": "blurry, low quality, bad anatomy, distorted, pixelated",
"num_inference_steps": 4,
"disable_safety_checker": false
},
});
console.log(result);
Python
import os
import requests
headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}
submitted = requests.post(
"https://queue.modelrunner.run/bytedance/sdxl-lightning-4step",
headers=headers,
json={
"seed": 452312,
"width": 1024,
"height": 1024,
"prompt": "A futuristic cyberpunk cityscape at night with neon lights reflecting on wet pavement, cinematic lighting, highly det…",
"scheduler": "K_EULER",
"num_outputs": 1,
"guidance_scale": 0,
"negative_prompt": "blurry, low quality, bad anatomy, distorted, pixelated",
"num_inference_steps": 4,
"disable_safety_checker": false
},
).json()
# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()
Input parameters
Input parameters of SDXL Lightning 4-step
Name
Type
Required
Description
prompt
string
no
Input prompt Default: "self-portrait of a woman, lightning in the background".
Use SDXL Lightning 4-step from Claude & Cursor (MCP)
Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and SDXL Lightning 4-step becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint bytedance/sdxl-lightning-4step.
claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp
Then ask your assistant, for example: “Run bytedance/sdxl-lightning-4step on ModelRunner to generate image”. MCP setup guide.
Model Details
Model Details
# SDXL-Lightning
**SDXL-Lightning** is a state-of-the-art text-to-image generation model designed for both **speed** and **quality**, capable of producing **high-resolution 1024px images** in remarkably few steps.
Built upon the foundation of [`stabilityai/stable-diffusion-xl-base-1.0`](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0), it leverages *Progressive Adversarial Diffusion Distillation* to achieve rapid yet powerful image synthesis.
## Features
- 🚀 **Lightning-fast inference** with 1-step, 2-step, 4-step, and 8-step distilled models.
- **2-step, 4-step, and 8-step** models deliver outstanding image quality.
- **1-step** model is experimental, exploring the limits of extreme efficiency.
- 🧩 **Model formats**:
- **Full UNet checkpoints** – deliver the best image quality.
- **LoRA checkpoints** – lightweight and easily applied to other base models.
## Open Source
We release SDXL-Lightning fully open-sourced as part of our research to empower the community with cutting-edge fast diffusion technology. For more details, please see our paper:
**SDXL-Lightning: Progressive Adversarial Diffusion Distillation**.