---
title: Stable Diffusion API — SDXL, SD 3, Flux & 10K+ Models | ModelsLab
description: Production Stable Diffusion API with SDXL, SD 3.5, Flux, ControlNet and 10,000+ community models. $0.002/image, sub-3s latency, free tier with 100 calls/day.
url: https://modelslab.com/stable-diffusion-api
canonical: https://modelslab.com/stable-diffusion-api
type: website
component: Seo/StableDiffusionApi
generated_at: 2026-06-08T01:56:44.686114Z
---

Imagen

Stable Diffusion API for Developers and Businesses
---

ModelsLab's Stable Diffusion API provides access to SD 1.5, SDXL, and SD 3.5 through a single REST endpoint. Image generation starts at $0.002 per image for standard models and $0.004 for SDXL, with 2-4 second latency and support for ControlNet, LoRA, inpainting, and custom fine-tuned models. An unlimited plan is available at $29/month.

[Get Stable Diffusion API Key](https://modelslab.com/register) [API Documentation](https://docs.modelslab.com)

What is the ModelsLab Stable Diffusion API?
---

### The Fastest Way to Run Stable Diffusion in Production

ModelsLab provides a production-ready Stable Diffusion API that gives developers instant access to SDXL, SD 1.5, SD 3.0, and over 10,000 community fine-tuned models through a single REST endpoint. Unlike self-hosted solutions that require managing GPU servers, ModelsLab handles all infrastructure — from model loading and GPU allocation to auto-scaling and failover.

The Stable Diffusion API supports text-to-image, image-to-image, inpainting, outpainting, and ControlNet workflows. Developers can generate up to 15 images in parallel with sub-3-second latency on dedicated A100 GPUs. Every API call returns images as URLs or base64 data, ready to serve directly to end users.

ModelsLab is trusted by over 50,000 developers and businesses worldwide, processing millions of image generations monthly. The platform offers transparent per-image pricing starting at $0.002 per generation, with unlimited plans available for high-volume users.

### Supported Stable Diffusion Models

ModelsLab supports the complete Stable Diffusion model family, including the latest architectures and community-trained variants:

- Stable Diffusion XL (SDXL) — High-resolution 1024×1024 photorealistic image generation with improved text rendering and composition
- Stable Diffusion 1.5 — Fast, versatile model ideal for rapid prototyping and creative exploration with the largest ecosystem of LoRAs and embeddings
- Stable Diffusion 3.0 — Latest architecture with improved prompt understanding, text generation in images, and multi-subject composition
- CivitAI Community Models — Import and run any of 100,000+ community-trained models directly via API, including specialized models for anime, photorealism, architecture, and more
- Custom Fine-Tuned Models — Train your own Stable Diffusion models with DreamBooth and deploy them to the API in minutes

Trusted by

![Google logo](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/669b27bc-f881-4e16-569d-4ce02f1bc000/768)

![Salesforce logo](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/8f7d9952-1dee-4108-f1e5-96ff77108e00/768)

![Amazon logo](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/b4d3bc1b-8c2b-4d98-7c87-ed162ccbf400/768)

![IBM logo](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/41bf250b-c933-4d8a-6355-07cf4a2fda00/768)

![Adobe logo](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/9eb124dd-95c4-4889-c838-faa0f6317000/768)

![Sony logo](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/2d67a30b-a490-4b96-ce1d-28d8371da300/768)

1B+

Images Processed Monthly

500K+

Active Developers

5K+

Discord Community Members

300+

Available AI APIs

Stable Diffusion API Quick Start
---

Generate images with Stable Diffusion in seconds. Here's how to make your first API call.

### Generate an image with cURL

bash

```
<code>1curl -X POST 'https://modelslab.com/api/v7/images/text-to-image' \
2  -H 'Content-Type: application/json' \
3  -d '{
4    "key": "YOUR_API_KEY",
5    "model_id": "sdxl",
6    "prompt": "a beautiful sunset over mountains, photorealistic, 8k",
7    "negative_prompt": "blurry, low quality",
8    "width": 1024,
9    "height": 1024,
10    "samples": 1,
11    "num_inference_steps": 30,
12    "guidance_scale": 7.5
13  }'</code>
```

### Generate an image with Python

Python

```
<code>1import requests
2

3url = "https://modelslab.com/api/v7/images/text-to-image"
4payload = {
5    "key": "YOUR_API_KEY",
6    "model_id": "sdxl",
7    "prompt": "a beautiful sunset over mountains, photorealistic, 8k",
8    "negative_prompt": "blurry, low quality",
9    "width": 1024,
10    "height": 1024,
11    "samples": 1,
12    "num_inference_steps": 30,
13    "guidance_scale": 7.5
14}
15

16response = requests.post(url, json=payload)
17data = response.json()
18print(data["output"])  # List of generated image URLs</code>
```

### Generate an image with JavaScript

JavaScript

```
<code>1const response = await fetch('https://modelslab.com/api/v7/images/text-to-image', {
2  method: 'POST',
3  headers: { 'Content-Type': 'application/json' },
4  body: JSON.stringify({
5    key: 'YOUR_API_KEY',
6    model_id: 'sdxl',
7    prompt: 'a beautiful sunset over mountains, photorealistic, 8k',
8    negative_prompt: 'blurry, low quality',
9    width: 1024,
10    height: 1024,
11    samples: 1,
12    num_inference_steps: 30,
13    guidance_scale: 7.5
14  })
15});
16

17const data = await response.json();
18console.log(data.output); // Array of generated image URLs</code>
```

Enterprise-Grade Stable Diffusion API Access
---

Run any Stable Diffusion model in production without managing GPU infrastructure. One API, thousands of models.

SDXL, SD 1.5, and Custom Models Access the full range of Stable Diffusion architectures. Run SDXL for photorealistic outputs, SD 1.5 for fast iterations, or load community-trained models from CivitAI directly via API.

ControlNet and LoRA Support Maintain precise control over image generation with ControlNet guidance and LoRA fine-tuning. Apply pose detection, depth maps, edge detection, and style transfers through API parameters.

Inpainting and Outpainting Edit existing images with AI-powered inpainting to remove or replace objects. Extend image boundaries with outpainting to create wider compositions, all via simple API calls.

Batch Processing and Parallel Generation Generate up to 15 images simultaneously with parallel processing. Ideal for e-commerce catalogs, marketing campaigns, and high-volume content pipelines that need fast turnaround.

![SDXL, SD 1.5, and Custom Models](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/8741a716-a81d-419a-c14f-88155af00c00/768)

![Example of AI outpainting result](https://images.stablediffusionapi.com/?image=https://assets.modelslab.ai/generations/09738200-f1fc-442c-9852-7d6a9cd56d34.png&quality=25)

![Example of AI outpainting result](https://images.stablediffusionapi.com/?image=https://assets.modelslab.ai/generations/851c5561-3239-4915-a66b-46d58d6c377c.png&quality=25)

![Example of AI outpainting result](https://images.stablediffusionapi.com/?image=https://assets.modelslab.ai/generations/70d56252-0444-431d-82b9-ad15c260263e.png&quality=25)

![Example of AI outpainting result](https://images.stablediffusionapi.com/?image=https://assets.modelslab.ai/generations/7b9995d6-68e1-48ba-bc0c-8e3a8f824faf.png&quality=25)

![Example of AI outpainting result](https://images.stablediffusionapi.com/?image=https://assets.modelslab.ai/generations/878fc33a-be9d-4fef-a8a5-f2f9931cd1d3.jpg&quality=25)

Deploy Stable Diffusion models at scale with low latency, high availability, and transparent pricing.

[Start Free Trial](https://modelslab.com/register)

Stable Diffusion API Comparison
---

See how ModelsLab compares to other Stable Diffusion API providers.

| Feature | ModelsLab | Hugging Face | Replicate | Leonardo AI |
|---|---|---|---|---|
| Models Available | 10,000+ | ~500 | ~200 | ~50 |
| SDXL Support | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
| SD 3.0 Support | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
| CivitAI Models | ✅ Direct Import | ❌ No | ❌ No | ❌ No |
| ControlNet | ✅ Full Suite | ✅ Limited | ✅ Limited | ✅ Limited |
| Starting Price | $0.002/image | $0.006/image | $0.005/image | $0.004/image |
| Unlimited Plan | ✅ $29/mo | ❌ No | ❌ No | ✅ $48/mo |
| Parallel Generation | Up to 15 | Up to 5 | Up to 5 | Up to 8 |
| Custom Model Training | ✅ DreamBooth | ✅ Yes | ✅ Yes | ✅ Yes |
| Avg Latency (SDXL) | ~2.5s | ~5s | ~4s | ~3s |

Data as of February 2026. Pricing based on publicly available information.

How to Use the Stable Diffusion API
---

Start generating images with Stable Diffusion in three steps.

STEP 01

STEP 01

### Step 1: Get Your API Key

Sign up for a free ModelsLab account and generate your API key from the dashboard. No credit card required to start.

STEP 02

STEP 02

### Step 2: Send Your First Request

Make a POST request to our Stable Diffusion endpoint with your prompt, model selection, and generation parameters. Use any language — Python, JavaScript, cURL, or our SDK.

STEP 03

STEP 03

### Step 3: Receive Generated Images

Get your images back as URLs or base64 data within seconds. Download, store, or serve them directly to your users with no additional processing needed.

[Get Your API Key ](https://modelslab.com/register)

### Stable Diffusion API Pricing

ModelsLab offers the most affordable Stable Diffusion API pricing in the market. Pay-as-you-go pricing starts at $0.002 per image generation for standard models and $0.004 for SDXL. For high-volume users, the unlimited plan at $29 per month provides unlimited access to Stable Diffusion models with parallel generation support.

Enterprise plans include dedicated GPU instances, custom SLAs, priority support, and volume discounts. All plans include a free tier with 100 API calls per day, making it easy to prototype and test before committing to a paid plan.

### API Authentication and Rate Limits

Authentication uses a simple API key passed in the request body. Rate limits are generous: free tier allows 100 requests per day, paid plans support 1,000 to 10,000 requests per minute depending on the plan. Enterprise customers get custom rate limits based on their GPU allocation.

### Stable Diffusion API Endpoints

The ModelsLab Stable Diffusion API provides dedicated endpoints for every image generation workflow:

- POST /api/v7/images/text-to-image — Generate images from text prompts with full control over model, resolution, sampling, and guidance parameters
- POST /api/v7/images/image-to-image — Transform existing images with text guidance, style transfer, and strength control
- POST /api/v7/images/inpaint — Edit specific regions of images using masks and text prompts
- POST /api/v7/images/controlnet — Use ControlNet preprocessors (Canny, Depth, OpenPose, Scribble) for precise composition control
- POST /api/v7/images/upscale — Upscale generated or existing images up to 8K resolution using Real-ESRGAN
- POST /api/v7/images/fetch/{request\_id} — Retrieve completed image generation results asynchronously

Why Developers Choose ModelsLab for Stable Diffusion
---

Key advantages that set us apart

Full Stable Diffusion SDXL and SD 1.5 model support

Access 10,000+ community models and LoRAs via API

ControlNet integration for pose, depth, and edge control

Parallel image generation — up to 15 at once

Transparent per-image pricing with no hidden fees

Sub-3-second generation times on dedicated GPUs

Inpainting, outpainting, and image-to-image endpoints

Automatic model loading — no cold starts

GDPR-compliant data handling and privacy

Python and JavaScript SDKs with full documentation

Upscale images up to 8K resolution

99.9% API uptime SLA for enterprise plans

24/7 developer support via Discord and email

No questions asked refund policy

Our Popular Use Cases

Industries using our Stable Diffusion API:

E-CommerceGame DevelopmentMarketing AgenciesSaaS ProductsPrint-on-DemandArchitecture and Interior Design

Generate product photography, lifestyle mockups, and marketing visuals at scale. Reduce studio costs with AI-generated product images via the Stable Diffusion API.

![E-Commerce](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/0fbacb1a-6e34-4254-0a9d-5e75178cf200/768)

Stable Diffusion API FAQ
---

### What is the Stable Diffusion API?

The Stable Diffusion API is a REST API that lets developers generate images from text prompts using Stable Diffusion models (SDXL, SD 1.5, SD 3.0) without managing GPU infrastructure. ModelsLab provides the API with access to over 10,000 models, sub-3-second latency, and pricing starting at $0.002 per image.

### How much does the Stable Diffusion API cost?

ModelsLab Stable Diffusion API pricing starts at $0.002 per image for SD 1.5 and $0.004 per image for SDXL. An unlimited plan is available at $29/month with unlimited generations. Enterprise plans with dedicated GPUs start at $299/month. All plans include a free tier with 100 API calls per day.

### Which Stable Diffusion models does the API support?

The API supports Stable Diffusion XL (SDXL), Stable Diffusion 1.5, Stable Diffusion 3.0, and over 10,000 community fine-tuned models from CivitAI. You can also train and deploy custom models using DreamBooth directly through the API.

### How fast is the Stable Diffusion API?

Average generation time is under 3 seconds for SDXL on dedicated A100 GPUs. SD 1.5 models generate in under 2 seconds. The API supports up to 15 parallel generations for batch processing workflows.

### Can I use ControlNet with the Stable Diffusion API?

Yes, ModelsLab supports the full ControlNet suite including Canny edge detection, depth maps, OpenPose, scribble, and more. Pass ControlNet parameters in your API request to guide image composition with reference images.

### Does ModelsLab support Stable Diffusion SDXL?

Yes, SDXL is fully supported with native 1024×1024 resolution output. ModelsLab offers all SDXL variants including SDXL Base, SDXL Refiner, SDXL Turbo for fast generation, and thousands of SDXL LoRA fine-tuned models.

### How do I get started with the Stable Diffusion API?

Sign up for a free ModelsLab account at modelslab.com, generate your API key from the dashboard, and make your first API call. No credit card is required for the free tier. The API uses simple REST endpoints with JSON payloads — see our documentation at docs.modelslab.com for full guides.

### Is the Stable Diffusion API suitable for production use?

Yes, ModelsLab is built for production workloads. The platform offers 99.9% uptime SLA, auto-scaling GPU infrastructure, webhook callbacks for async processing, and enterprise support with dedicated account managers. Over 50,000 developers use ModelsLab in production.

Your Data is Secure: GDPR Compliant AI Services
---

![ModelsLab GDPR Compliance Certification Badge](https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/28133112-07fe-4c1c-44eb-36948d51ae00/768)

AI Image API Pricing Starting at $0.0047 Per Image
---

ModelsLab offers a free tier with pay-as-you-go pricing, a Standard plan at $47/month for 10,000 API calls, and a Premium plan at $199/month with unlimited calls. All plans include access to Flux, SDXL, Stable Diffusion 3, and 10,000+ community models. Cancel anytime.

Coming Soon
---

We are making some changes to our pricing, please check back later.

Get Expert Support in Seconds

We're Here to Help.
---

Want to know more? You can email us anytime at <support@modelslab.com>

Chat with support[View Docs](https://docs.modelslab.com)


Explore Our Other Solutions
---

Unlock your creative potential and scale your business with ModelsLab's comprehensive suite of AI-powered solutions.

[Audio Gen

### AI Audio Generation

Text-to-speech, voice cloning, music generation, and audio processing APIs.

Explore Audio Gen](https://modelslab.com/audio-gen) [Video Fusion

### AI Video Generation & Tools

Create, edit, and enhance videos with AI-powered generation and transformation tools.

Explore Video Fusion](https://modelslab.com/video-fusion) [Chat

### Engage Seamlessly with LLM

Access powerful language models for chatbots, content generation, and AI assistants.

Explore Chat](https://modelslab.com/custom-llm) [3D Verse

### Create Stunning 3D Models

Transform images and text into 3D models with advanced AI-powered generation.

Explore 3D Verse](https://modelslab.com/3d-verse)

Plugins

Explore Plugins for Pro
---

Our plugins are designed to work with the most popular content creation software.

[Explore Plugins](https://modelslab.com/pro#plugins) [Learn More](https://modelslab.com/pro)

API

Build Apps with ModelsLab

ML

 API
---

Use our API to build apps, generate AI art, create videos, and produce audio with ease.

[API Documentation](https://docs.modelslab.com) [Playground](https://modelslab.com/models)

## Frequently Asked Questions

### How do I run Stable Diffusion through an API without managing GPUs?
Use the ModelsLab Stable Diffusion API. POST to /api/v7/images/text-to-image with model_id "sd-1.5", "sdxl", or "sd-3.5" — ModelsLab runs the model on managed GPUs and returns image URLs in the JSON response. No CUDA setup, no cold starts.

### What is the ModelsLab Stable Diffusion API pricing?
$0.002 per image pay-as-you-go or $29/month unlimited. All Stable Diffusion variants (1.5, 2.1, SDXL, SD 3, SD 3.5, Turbo, Lightning) are included at the same price. No resolution upcharges up to 2048×2048.

### Does the API support SDXL, SD 3.5 and ControlNet?
Yes. Pass model_id="sdxl" or "sd-3.5" for the latest checkpoints. ControlNet (pose, depth, canny, openpose, scribble) is enabled by adding a controlnet_model parameter — same endpoint, no separate integration.

### Can I run my own LoRA or checkpoint via the API?
Yes. Upload custom LoRAs and full checkpoints through the LoRA training and model-import endpoints, then call them by model_id. CivitAI imports are a one-click operation from the dashboard or via the API.

### What latency should I expect for Stable Diffusion API calls?
Sub-3-second p50 for SDXL at 1024×1024 on warm models. p95 under 5s. SD 1.5 is faster (~1.5s p50). Cold-start overhead for rarely used community models is 1–2s on first call, then warm.

### Is there a free Stable Diffusion API to try?
Yes — ModelsLab's free tier gives 100 API calls/day across all SD variants and 10,000+ community models. No credit card required to sign up.

### How does ModelsLab compare to Stability AI's own API?
ModelsLab is ~3× cheaper per image ($0.002 vs $0.006), has a free tier, includes 10,000+ community models (Stability's API is limited to their own checkpoints), and offers a $29/month unlimited plan that Stability does not.

### Does the API support inpainting and image-to-image with Stable Diffusion?
Yes. Use /api/v7/images/inpaint for masked editing and /api/v7/images/image-to-image for whole-image transforms. Both work with every SD variant via the model_id parameter.


---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-06-08*