Generate stunning 1024×1024 images with Stable Diffusion XL via a simple REST API. 13-second generation, $0.005/image. No GPU required.
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 imageJust $0.005/image (5 credits). Up to 10x cheaper than Replicate or Stability AI's hosted API. No minimum spend.
Dedicated NVIDIA RTX GPUs — the model is always warm. Consistent 13-second generation, every time.
Negative prompts, guidance scale, inference steps, seed control. Get exactly the output you need.
One POST request, one image back. No webhooks, no polling, no async complexity. Works with any language.
100 free credits on signup — generate 20 SDXL images for free. No credit card required.
Get PNG output at 1024×1024, 768×1024, 1024×768 and other standard aspect ratios.
| Provider | Price / Image | Speed | Cold Starts | Free Tier |
|---|---|---|---|---|
| PixelAPI | $0.005 | ~13s | None | 100 credits free |
| Replicate | $0.02–0.05 | 10–30s | Yes (serverless) | Limited |
| Stability AI | $0.01–0.04 | 5–15s | No | 25 credits free |
| RunPod | $0.01+ (GPU rental) | Variable | Yes | No |
| Self-hosted | $0.50+/hr GPU | Variable | N/A | N/A |
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt | string | required | Text description of the image to generate |
negative_prompt | string | "" | Elements to exclude from generation |
width | int | 1024 | Image width (512–1024) |
height | int | 1024 | Image height (512–1024) |
guidance_scale | float | 7.5 | How closely to follow the prompt (1–20) |
num_inference_steps | int | 30 | Quality/speed tradeoff (20–50) |
seed | int | random | For reproducible outputs |
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.
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.
SDXL generates images in approximately 13 seconds on PixelAPI's dedicated NVIDIA RTX GPUs. This includes inference time and image encoding.
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.
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.