Ana içeriğe geç
bytedance avatarı

SDXL Lightning 4-step API

bytedance/sdxl-lightning-4step

SDXL-Lightning, Stable Diffusion XL’den damıtılmış, yalnızca birkaç adımda yüksek kaliteli 1024px görseller üreten yıldırım hızında bir text-to-image modelidir.

Model girdisi

Input

Input prompt

Negative Input prompt

Min: 256 - Max: 1280

Width of output image. Recommended 1024 or 1280

Min: 256 - Max: 1280

Height of output image. Recommended 1024 or 1280

Min: 1 - Max: 4

Number of images to output.

scheduler

Min: 1 - Max: 10

Number of denoising steps. 4 for best results

Min: 0 - Max: 50

Scale for classifier-free guidance

Random seed. Leave blank to randomize the seed

Disable safety checker for generated images

You need to be logged in to run this model and view results.
Log in

Model çıktısı

Output

Generated image output
Generated in 1.938 seconds
Logs (7 lines)

Örnek istekler

Örnekler

Example output 1Example output 2Example output 3Example output 4Example output 5

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": 103,
    "width": 1280,
    "height": 1024,
    "prompt": "two friends cooking together in a sunlit Scandinavian kitchen, one slicing herbs while the other stirs a pot, visible…",
    "scheduler": "K_EULER",
    "num_outputs": 1,
    "guidance_scale": 0,
    "negative_prompt": "worst quality, low quality, deformed, extra fingers, fused hands, disembodied limbs, awkward pose, motion blur, water…",
    "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": 103,
    "width": 1280,
    "height": 1024,
    "prompt": "two friends cooking together in a sunlit Scandinavian kitchen, one slicing herbs while the other stirs a pot, visible…",
    "scheduler": "K_EULER",
    "num_outputs": 1,
    "guidance_scale": 0,
    "negative_prompt": "worst quality, low quality, deformed, extra fingers, fused hands, disembodied limbs, awkward pose, motion blur, water…",
    "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": 103,
      "width": 1280,
      "height": 1024,
      "prompt": "two friends cooking together in a sunlit Scandinavian kitchen, one slicing herbs while the other stirs a pot, visible…",
      "scheduler": "K_EULER",
      "num_outputs": 1,
      "guidance_scale": 0,
      "negative_prompt": "worst quality, low quality, deformed, extra fingers, fused hands, disembodied limbs, awkward pose, motion blur, water…",
      "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
NameTypeRequiredDescription
promptstringnoInput prompt Default: "self-portrait of a woman, lightning in the background".
negative_promptstringnoNegative Input prompt Default: "worst quality, low quality".
widthintegernoWidth of output image. Recommended 1024 or 1280 Default: 1024.
heightintegernoHeight of output image. Recommended 1024 or 1280 Default: 1024.
num_outputsintegernoNumber of images to output. Default: 1.
schedulerenumnoscheduler One of: DDIM, DPMSolverMultistep, HeunDiscrete, KarrasDPM, K_EULER_ANCESTRAL, K_EULER, PNDM, DPM++2MSDE. Default: "K_EULER".
num_inference_stepsintegernoNumber of denoising steps. 4 for best results Default: 4.
guidance_scalenumbernoScale for classifier-free guidance Default: 0.
seedintegernoRandom seed. Leave blank to randomize the seed Default: 0.
disable_safety_checkerbooleannoDisable safety checker for generated images Default: false.

Machine-readable: OpenAPI schema · llms.txt

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.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

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 Detayları

Model Detayları

# SDXL-Lightning

**SDXL-Lightning**, hem **hız** hem de **kalite** için tasarlanmış, son teknoloji bir text-to-image üretim modelidir; şaşırtıcı derecede az adımda **yüksek çözünürlüklü 1024px görseller** üretebilir.

[`stabilityai/stable-diffusion-xl-base-1.0`](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) temeli üzerine kurulmuştur ve hızlı ama güçlü görsel sentezi için *Progressive Adversarial Diffusion Distillation* yöntemini kullanır.

## Özellikler - 🚀 1, 2, 4 ve 8 adımlık damıtılmış modellerle **yıldırım hızında inference**. - **2, 4 ve 8 adımlık** modeller olağanüstü görsel kalitesi sunar. - **1 adımlık** model deneyseldir; uç verimliliğin sınırlarını araştırır.

- 🧩 **Model formatları**: - **Tam UNet checkpoint’leri** – en iyi görsel kalitesini verir. - **LoRA checkpoint’leri** – hafiftir ve başka temel modellere kolayca uygulanır.

## Open Source SDXL-Lightning’i, topluluğu en ileri hızlı diffusion teknolojisiyle güçlendirme araştırmamızın bir parçası olarak tamamen open source yayımlıyoruz. Ayrıntılar için makalemize bakın: **SDXL-Lightning: Progressive Adversarial Diffusion Distillation**.