Image by Stable Diffusion

Stable Diffusion 3.5 Medium API

A 2.5-billion-parameter Stable Diffusion 3.5 model balancing quality, speed, and efficiency — a great default for high-volume generation.

Integrate Stable Diffusion 3.5 Medium with a single API call — one key, one unified endpoint, and shared billing across every model on Apiframe.

model: "stable-diffusion-3.5-medium"

What's special about Stable Diffusion 3.5 Medium

Efficient and affordable

A right-sized SD 3.5 model at just 7 credits per image for high-volume workloads.

Text and image to image

Generate from a prompt or refine an existing image with adjustable prompt_strength.

Full control set

Aspect ratio, cfg, steps, seed, negative prompt, and output format are all supported.

Made with Stable Diffusion 3.5 Medium

A few outputs generated through the Stable Diffusion 3.5 Medium API on Apiframe.

Sample coming soon

A cinematic portrait of an astronaut in a neon-lit alley, 85mm, shallow depth of field

Sample coming soon

Cozy isometric coffee shop, warm morning light, highly detailed 3D render

Sample coming soon

A majestic snow leopard on a misty mountain ridge at golden hour

Overview

Endpoint
POST /v2/images/generate
Model ID
stable-diffusion-3.5-medium
Params key
stableDiffusionParams
Modality
Image
Provider
Stable Diffusion
Avg. completion
~7s

Capabilities

Aspect ratios1:1, 16:9, 21:9, 3:2, 2:3, 4:5, 5:4, 9:16, 9:21
Image inputSupported
Avg. time~7s

Quick start

Send a single POST /v2/images/generate request with your API key to generate with Stable Diffusion 3.5 Medium. The call returns a jobId you can poll or receive via webhook.

curl -X POST https://api.apiframe.ai/v2/images/generate \
  -H "X-API-Key: afk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
        "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
        "model": "stable-diffusion-3.5-medium",
        "stableDiffusionParams": {
            "image": "https://example.com/input.jpg",
            "prompt_strength": 0.85,
            "negative_prompt": "What you do NOT want to see…",
            "cfg": 3.5
        }
    }'
import requests

response = requests.post(
    "https://api.apiframe.ai/v2/images/generate",
    headers={
        "X-API-Key": "afk_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
        "model": "stable-diffusion-3.5-medium",
        "stableDiffusionParams": {
            "image": "https://example.com/input.jpg",
            "prompt_strength": 0.85,
            "negative_prompt": "What you do NOT want to see…",
            "cfg": 3.5
        }
    },
)
print(response.json())  # { "jobId": "...", "status": "QUEUED" }
const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
  method: "POST",
  headers: {
    "X-API-Key": "afk_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
    "model": "stable-diffusion-3.5-medium",
    "stableDiffusionParams": {
      "image": "https://example.com/input.jpg",
      "prompt_strength": 0.85,
      "negative_prompt": "What you do NOT want to see…",
      "cfg": 3.5
    }
  }),
});
const { jobId } = await response.json();
console.log(jobId);

Response & job lifecycle

Generation is asynchronous. A successful submission returns 202 Accepted with a jobId. Poll GET /v2/jobs/{id} (or supply a webhook_url) until the status is COMPLETED; the result field then holds the output URL(s).

1. Submission response (202)

{
  "jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "status": "QUEUED"
}

2. Poll for the result

curl https://api.apiframe.ai/v2/jobs/JOB_ID \
  -H "X-API-Key: afk_your_api_key_here"
import requests, time

while True:
    job = requests.get(
        "https://api.apiframe.ai/v2/jobs/JOB_ID",
        headers={"X-API-Key": "afk_your_api_key_here"},
    ).json()
    if job["status"] in ("COMPLETED", "FAILED"):
        break
    time.sleep(2)
print(job["result"])
let job;
do {
  await new Promise((r) => setTimeout(r, 2000));
  job = await fetch("https://api.apiframe.ai/v2/jobs/JOB_ID", {
    headers: { "X-API-Key": "afk_your_api_key_here" },
  }).then((r) => r.json());
} while (job.status !== "COMPLETED" && job.status !== "FAILED");
console.log(job.result);

Input schema

Request parameters accepted by the Stable Diffusion 3.5 Medium endpoint. Model-specific options are nested under the params object shown below.

Parameter Type Required Default Allowed / range Description
prompt string required Text description of what to generate.
model string required "stable-diffusion-3.5-medium" "stable-diffusion-3.5-medium" The model identifier for this endpoint.
stableDiffusionParams.image string (URL) optional Optional image for image-to-image mode. Output matches its aspect ratio.
stableDiffusionParams.prompt_strength number optional 0.85 min 0, max 1, step 0.05 Denoising strength for image-to-image (0–1). 1.0 ignores the input image.
stableDiffusionParams.negative_prompt string optional Negative prompt
stableDiffusionParams.cfg number optional 3.5 min 0, max 20, step 0.1 How strictly to follow the prompt.
stableDiffusionParams.steps number optional 28 min 1, max 40, step 1 Steps
stableDiffusionParams.output_format string optional "webp" "webp", "jpg", "png" Output format
stableDiffusionParams.output_quality number optional 90 min 0, max 100, step 1 Output quality
stableDiffusionParams.seed number optional step 1 Reuse a number to reproduce the same result.

Frequently Asked Questions

Common questions about the Stable Diffusion 3.5 Medium API.

What does Stable Diffusion 3.5 Medium cost?

Pricing is flat: 7 credits per generated image.

Still have questions?

Start building with the Stable Diffusion 3.5 Medium API

Get your API key and integrate Stable Diffusion 3.5 Medium in minutes — Pay-as-you-go.

Free credits to start
One API for every model
Webhooks, SDKs & idempotency
No provider account required

Questions? Join our Discord or contact sales.