Pricing per million tokens, context window, capabilities — pulled from each provider's public docs. All 2 are available via the same AIgateway OpenAI-compatible endpoint; flip the model string to switch.
SDXL-Lightning is a lightning-fast text-to-image generation model. It can generate high-quality 1024px images in a few steps.
Stable Diffusion is a latent text-to-image diffusion model capable of generating photo-realistic images. Img2img generate a new image from an input image with Stable Diffusion.
from openai import OpenAI
client = OpenAI(
base_url="https://api.aigateway.sh/v1",
api_key="sk-aig-...",
)
# Stable-Diffusion-XL-Lightning
client.chat.completions.create(
model="bytedance/stable-diffusion-xl-lightning",
messages=[{"role":"user","content":"hello"}],
)
# Stable-Diffusion-V1-5-Img2img
client.chat.completions.create(
model="runwayml/stable-diffusion-v1-5-img2img",
messages=[{"role":"user","content":"hello"}],
)