Image GenerationStable Diffusion
Stable Diffusion 3
The original SD 3 Medium MMDiT model with strong prompt adherence and typography.
POST /v2/images/generate — model: "stable-diffusion-3"
Stable Diffusion 3 Medium is a 2-billion-parameter Multimodal Diffusion Transformer (MMDiT) model from Stability AI. It excels at photorealism, typography, and complex prompt understanding. Supports image-to-image via the image parameter.
See Image Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Description |
|---|---|---|
stableDiffusionParams.aspect_ratio | string | Output aspect ratio. Values: "1:1", "16:9", "21:9", "3:2", "2:3", "4:5", "5:4", "9:16", "9:21". Ignored when image is set |
stableDiffusionParams.cfg | number | Guidance scale (0–20). How strictly to follow the prompt. Default 3.5 |
stableDiffusionParams.steps | integer | Number of sampling steps (1–28). Values above 28 are clamped. Default 28 |
stableDiffusionParams.seed | integer | Random seed for reproducible generation |
stableDiffusionParams.negative_prompt | string | What you do NOT want to see in the image |
stableDiffusionParams.image | string | Input image URL for image-to-image mode. Output aspect ratio matches this image |
stableDiffusionParams.prompt_strength | number | Denoising strength for image-to-image (0–1). 1.0 fully replaces the input image. Default 0.85 |
stableDiffusionParams.output_format | string | Output image format. Values: "webp", "jpg", "png". Default "webp" |
stableDiffusionParams.output_quality | integer | Output quality for lossy formats (0–100). Default 90 |
Credit cost
| Credits per generation |
|---|
| 7 |
Example result
Once the job is COMPLETED, the result object on GET /v2/jobs/:id looks like:
{
"images": [
"https://cdn2.apiframe.ai/images/a1b2c3d4-e5f6-7890-abcd-ef1234567890-1.png"
]
}See Result format for field details.
Code examples
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 vintage travel poster of Kyoto with bold typography",
"model": "stable-diffusion-3",
"stableDiffusionParams": {
"aspect_ratio": "2:3",
"cfg": 3.5,
"steps": 28
}
}'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 vintage travel poster of Kyoto with bold typography",
"model": "stable-diffusion-3",
"stableDiffusionParams": {
"aspect_ratio": "2:3",
"cfg": 3.5,
"steps": 28,
},
},
)
print(response.json())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 vintage travel poster of Kyoto with bold typography",
model: "stable-diffusion-3",
stableDiffusionParams: { aspect_ratio: "2:3", cfg: 3.5, steps: 28 },
}),
});
console.log(await response.json());Try it
POST
/v2/images/generateTry it