Mage API · Image model

Stable Diffusion v1.5 API

The classic, on a budget

Get an API keyTry Stable Diffusion v1.5 in the playground
POST https://api.mage.space/v1/stable_diffusion_v15/generate

At a glance

The Stable Diffusion v1.5 API runs Stable Diffusion v1.5 through Mage at POST https://api.mage.space/v1/stable_diffusion_v15/generate. A request at the default settings costs 10 Gems (about $0.01), with no subscription. Stable Diffusion v1.5 takes no @handle mentions.

Overview

What the Stable Diffusion v1.5 API does

The original Stable Diffusion 1.5, at a budget price. Text-to-image or from one input image, perfect for matching older work.

The classic Stable Diffusion 1.5, with an optional input image.

It accepts image as inputs.

Quick start

Call the Stable Diffusion v1.5 API

Set MAGE_API_KEY, submit to /stable_diffusion_v15/generate, and poll status_url until the request completes.

cURL
STATUS_URL=$(curl --request POST 'https://api.mage.space/v1/stable_diffusion_v15/generate' \
  --header "Authorization: Bearer $MAGE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "prompt": "Editorial portrait in soft daylight, 35mm film look",
  "aspect_ratio": "4:5",
  "model_id": "15012C538F503CE2EBFC2C8547B268C75CCDAFF7A281DB55399940FF1D70E21D"
}' | jq -r '.status_url')

# Repeat until status is "completed"; result.url is the file
curl "$STATUS_URL" --header "Authorization: Bearer $MAGE_API_KEY"
Python
import os, time, requests

headers = {"Authorization": f"Bearer {os.environ['MAGE_API_KEY']}"}
request = requests.post(
    "https://api.mage.space/v1/stable_diffusion_v15/generate",
    headers=headers,
    json={
      "prompt": "Editorial portrait in soft daylight, 35mm film look",
      "aspect_ratio": "4:5",
      "model_id": "15012C538F503CE2EBFC2C8547B268C75CCDAFF7A281DB55399940FF1D70E21D"
    },
).json()

while request["status"] in ("queued", "in_progress"):
    time.sleep(3)
    request = requests.get(request["status_url"], headers=headers).json()

print(request["status"], request["result"] and request["result"]["url"])
JavaScript
const headers = {
  Authorization: `Bearer ${process.env.MAGE_API_KEY}`,
  'Content-Type': 'application/json',
};
let request = await fetch('https://api.mage.space/v1/stable_diffusion_v15/generate', {
  method: 'POST',
  headers,
  body: JSON.stringify({
    "prompt": "Editorial portrait in soft daylight, 35mm film look",
    "aspect_ratio": "4:5",
    "model_id": "15012C538F503CE2EBFC2C8547B268C75CCDAFF7A281DB55399940FF1D70E21D"
  }),
}).then((response) => response.json());

while (['queued', 'in_progress'].includes(request.status)) {
  await new Promise((resolve) => setTimeout(resolve, 3000));
  request = await fetch(request.status_url, { headers }).then((r) => r.json());
}

console.log(request.status, request.result?.url);

Models

Stable Diffusion v1.5 model_id values

Send model_id to pick a variant. A request without one runs the default.

model_idNameDefault
15012C538F503CE2EBFC2C8547B268C75CCDAFF7A281DB55399940FF1D70E21DStable Diffusion v1.5Yes

Options

Stable Diffusion v1.5 parameters

Allowed values across all variants; a variant may offer fewer. The docs list the options per variant.

FieldValues
aspect_ratio21:9, 16:9, 3:2, 5:4, 1:1, 4:5, 2:3, 9:16, 9:21

Inputs

Media inputs Stable Diffusion v1.5 accepts

Send each as an https URL, a data URL, or an upload of up to 100 MB.

FieldRole
imageThe reference image.

More image models

Other image generation APIs on Mage

Image · from 10 Gems

Stable Diffusion v3.5 Large API

The Stable Diffusion that listens best

Image · from 10 Gems

Stable Diffusion XL API

Photoreal-tuned SDXL

Image · from 10 Gems

Z-Image API

The fastest image model on Mage

Image · from 20 Gems

Anima API

Purpose-built for anime

Image · from 35 Gems

Chroma API

Open-weights, built on Flux

Image · from 40 Gems

Flux 2 API

Long prompts and multi-reference edits

FAQ

Frequently asked questions

How much does the Stable Diffusion v1.5 API cost?

A Stable Diffusion v1.5 request at the default settings (Stable Diffusion v1.5) costs 10 Gems, about $0.01. Other resolutions, durations, and variants change the price; the response reports the exact charge. A generation that fails is refunded; one Mage's content policy blocks is not.

What is the Stable Diffusion v1.5 API endpoint?

POST https://api.mage.space/v1/stable_diffusion_v15/generate with an Authorization: Bearer header carrying your Mage API key. The response includes a status_url to poll for the result.

Which Stable Diffusion v1.5 models can I call?

15012C538F503CE2EBFC2C8547B268C75CCDAFF7A281DB55399940FF1D70E21D. The default is Stable Diffusion v1.5.

Does Stable Diffusion v1.5 support reference images or characters?

Stable Diffusion v1.5 accepts image. Stable Diffusion v1.5 takes no @handle mentions.

Can I use Stable Diffusion v1.5 from Claude or ChatGPT?

Yes. Connect the Mage MCP server to Claude, ChatGPT, Claude Code, Grok, or Cursor and ask for Stable Diffusion v1.5 by name. Your assistant reads its options with get_model and quotes the price before it generates.

How long are Stable Diffusion v1.5 results kept?

Results and inputs are kept for 30 days. Download anything you want to keep to your own storage.

Start building with Mage

One account, one Gems balance, every model. Pay only for what you generate.

Get an API keyTry Stable Diffusion v1.5 in the playground

Related