Text-to-Image Model

SDXL Image Generation API

Generate stunning 1024×1024 images with Stable Diffusion XL via a simple REST API. 13-second generation, $0.005/image. No GPU required.

1024²
Resolution
13s
Generation Time
$0.005
Per Image
5
Credits

Quick Start — Generate an Image in 3 Lines

Python
JavaScript
cURL
import requests response = requests.post("https://api.pixelapi.dev/v1/sdxl", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "prompt": "A serene Japanese garden at sunset, koi pond, cherry blossoms", "negative_prompt": "blurry, low quality, distorted", "width": 1024, "height": 1024, "guidance_scale": 7.5, "num_inference_steps": 30 } ) # Save the generated image with open("output.png", "wb") as f: f.write(response.content) print("Image saved!")
// JavaScript / Node.js const response = await fetch("https://api.pixelapi.dev/v1/sdxl", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ prompt: "A serene Japanese garden at sunset, koi pond, cherry blossoms", negative_prompt: "blurry, low quality, distorted", width: 1024, height: 1024, guidance_scale: 7.5, num_inference_steps: 30 }) }); const blob = await response.blob(); // Use the generated image

Why Use PixelAPI for SDXL?

💰 Cheapest SDXL API

Just $0.005/image (5 credits). Up to 10x cheaper than Replicate or Stability AI's hosted API. No minimum spend.

⚡ No Cold Starts

Dedicated NVIDIA RTX GPUs — the model is always warm. Consistent 13-second generation, every time.

🎨 Full Control

Negative prompts, guidance scale, inference steps, seed control. Get exactly the output you need.

🔗 Simple REST API

One POST request, one image back. No webhooks, no polling, no async complexity. Works with any language.

🆓 Free to Start

100 free credits on signup — generate 20 SDXL images for free. No credit card required.

📦 Multiple Formats

Get PNG output at 1024×1024, 768×1024, 1024×768 and other standard aspect ratios.

SDXL API Pricing — Compared

ProviderPrice / ImageSpeedCold StartsFree Tier
PixelAPI$0.005~13sNone100 credits free
Replicate$0.02–0.0510–30sYes (serverless)Limited
Stability AI$0.01–0.045–15sNo25 credits free
RunPod$0.01+ (GPU rental)VariableYesNo
Self-hosted$0.50+/hr GPUVariableN/AN/A

API Parameters

ParameterTypeDefaultDescription
promptstringrequiredText description of the image to generate
negative_promptstring""Elements to exclude from generation
widthint1024Image width (512–1024)
heightint1024Image height (512–1024)
guidance_scalefloat7.5How closely to follow the prompt (1–20)
num_inference_stepsint30Quality/speed tradeoff (20–50)
seedintrandomFor reproducible outputs

Frequently Asked Questions

How much does SDXL API cost?

Each SDXL image generation costs 5 credits ($0.005/image). PixelAPI offers 100 free credits on signup — no credit card required. Paid plans start at $10/month for 10,000 credits.

What resolution does the SDXL API generate?

The SDXL API generates images at 1024×1024 resolution by default. You can also specify other aspect ratios like 768×1024 or 1024×768 for portrait/landscape images.

How fast is SDXL image generation?

SDXL generates images in approximately 13 seconds on PixelAPI's dedicated NVIDIA RTX GPUs. This includes inference time and image encoding.

How does PixelAPI SDXL compare to Replicate?

PixelAPI's SDXL costs $0.005/image compared to Replicate's ~$0.02–0.05/image. PixelAPI runs on dedicated GPUs (no cold starts), while Replicate uses serverless infrastructure with variable latency.

Can I use negative prompts with the SDXL API?

Yes. The SDXL API supports negative prompts to exclude unwanted elements, configurable guidance scale (CFG), number of inference steps, and seed control for reproducible outputs.

Explore More AI Models