> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openference.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Image generation models

> Stable Diffusion and other image models on POST /v1/images/generations.

# Image generation models

Openference exposes image models on [POST /v1/images/generations](/api-reference/images). **Stable Diffusion** models (Cloudflare) use pixel `size` and optional diffusion controls. Each successful image consumes plan requests at the model's ratio (see [Model Request Ratios](/getting-started/model-ratios)).

Use the `model` ids below in your request body. Aliases are also accepted (e.g. `sdxl-lightning` → `SDXL Lightning`).

***

## SDXL Lightning (`sdxl-lightning`)

**Task:** text-to-image\
**Best for:** fast previews and drafts (few diffusion steps)

| Parameter         | Default     | Range / notes               |
| ----------------- | ----------- | --------------------------- |
| `prompt`          | —           | Required                    |
| `size`            | `1024x1024` | 256–2048 px, multiples of 8 |
| `num_steps`       | **4**       | 1–20                        |
| `guidance`        | 7.5         | Positive number             |
| `negative_prompt` | —           | Optional                    |
| `seed`            | —           | Optional integer            |

```bash theme={null}
curl https://api.openference.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sdxl-lightning",
    "prompt": "A red cube on a white background, product photo",
    "size": "1024x1024",
    "num_steps": 4
  }'
```

***

## SDXL Base 1.0 (`sdxl-base`)

**Task:** text-to-image\
**Best for:** higher-quality still images (more steps than Lightning)

| Parameter         | Default     | Range / notes               |
| ----------------- | ----------- | --------------------------- |
| `prompt`          | —           | Required                    |
| `size`            | `1024x1024` | 256–2048 px, multiples of 8 |
| `num_steps`       | **20**      | 1–20                        |
| `guidance`        | 7.5         | Positive number             |
| `negative_prompt` | —           | Optional                    |
| `seed`            | —           | Optional integer            |

```bash theme={null}
curl https://api.openference.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sdxl-base",
    "prompt": "Oil painting of a mountain lake at sunset",
    "size": "1024x1024",
    "num_steps": 20,
    "guidance": 7.5
  }'
```

***

## Errors

| HTTP | Code                | Meaning                                |
| ---- | ------------------- | -------------------------------------- |
| 400  | `invalid_num_steps` | `num_steps` out of range for the model |

See [POST /v1/images/generations](/api-reference/images) and [Common errors](/troubleshooting/common-errors) for the full list.
