Image GenerationStability AIOpen SourceFastEfficient

Stable Diffusion XL API

The most popular open-source image generator with vast ecosystem support and affordable pricing.

Parameters

6.6B

Context

N/A

Organization

Stability AI


Quick Start

Start using Stable Diffusion XL in minutes. VoltageGPU provides an OpenAI-compatible API — just change the base_url.

Python (OpenAI SDK)
pip install openai
from openai import OpenAI

client = OpenAI(
    base_url="https://api.voltagegpu.com/v1",
    api_key="YOUR_VOLTAGE_API_KEY"
)

response = client.images.generate(
    model="stabilityai/stable-diffusion-xl-base-1.0",
    prompt="A serene Japanese garden with cherry blossoms, koi pond, wooden bridge, watercolor style",
    n=1,
    size="1024x1024"
)

image_url = response.data[0].url
print(f"Generated image: {image_url}")
cURL
Terminal
curl -X POST https://api.voltagegpu.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VOLTAGE_API_KEY" \
  -d '{
    "model": "stabilityai/stable-diffusion-xl-base-1.0",
    "prompt": "A serene Japanese garden with cherry blossoms, koi pond, wooden bridge, watercolor style",
    "n": 1,
    "size": "1024x1024"
  }'

Pricing

ComponentPriceUnit
Image Generation$0.04per image

New accounts receive $5 free credit. No credit card required to start.


Capabilities & Benchmarks

SDXL generates 1024x1024 native resolution images with strong prompt adherence and artistic range. It supports negative prompts for fine-grained control, CFG scale adjustment, multiple samplers (DPM++, Euler, etc.), and seed-based reproducibility. The model works with thousands of community LoRA weights for style and subject customization, ControlNet for structural guidance, and img2img for image editing.


About Stable Diffusion XL

Stable Diffusion XL (SDXL) is Stability AI's most popular open-source image generation model. With 6.6 billion parameters split across a base model and refiner, SDXL generates high-quality 1024x1024 images with excellent prompt understanding and artistic versatility. It supports a vast ecosystem of LoRA adapters, ControlNet, and community fine-tunes. SDXL remains the go-to choice for developers who need reliable, fast, and affordable image generation with extensive customization options.


Use Cases

🚀

Rapid Prototyping

Quickly generate visual concepts, mockups, and design explorations at minimal cost.

📱

Social Media Content

Create engaging social media images, stories, and visual posts at scale.

🎭

Custom Style Generation

Use LoRA adapters to generate images in specific brand styles or artistic genres.

📦

Batch Image Processing

Generate thousands of images for catalogs, datasets, or content pipelines affordably.

📖

Educational Materials

Create illustrations, diagrams, and visual aids for educational content.


API Reference

Endpoint

POSThttps://api.voltagegpu.com/v1/images/generations

Headers

AuthorizationBearer YOUR_VOLTAGE_API_KEYRequired
Content-Typeapplication/jsonRequired

Model ID

stabilityai/stable-diffusion-xl-base-1.0

Use this value as the model parameter in your API requests.

Example Request

curl -X POST https://api.voltagegpu.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VOLTAGE_API_KEY" \
  -d '{
    "model": "stabilityai/stable-diffusion-xl-base-1.0",
    "prompt": "A serene Japanese garden with cherry blossoms, koi pond, wooden bridge, watercolor style",
    "n": 1,
    "size": "1024x1024"
  }'



Frequently Asked Questions

How does SDXL compare to FLUX.1 Pro?

FLUX.1 Pro offers higher quality and better prompt adherence, while SDXL is more affordable ($0.04 vs $0.055/image) and has a larger ecosystem of LoRA adapters and community tools. SDXL is better for batch processing and when you need style customization, while FLUX.1 Pro is better for maximum quality.

Can I use custom LoRA models with SDXL?

Through VoltageGPU's API, you can use SDXL with the base model configuration. For custom LoRA models, contact VoltageGPU support for enterprise custom model hosting options.

Is SDXL open source?

Yes, Stable Diffusion XL is open source and released under the CreativeML Open RAIL++-M license, which allows both personal and commercial use with certain restrictions on harmful content generation.

What image sizes does SDXL support?

SDXL natively generates 1024x1024 images but supports various aspect ratios including 768x1024, 1024x768, 896x1152, and other common dimensions.


Start using Stable Diffusion XL today

Get $5 free credit when you sign up. No credit card required. Deploy in under 30 seconds with our OpenAI-compatible API.