# Image Generate

- **Method:** `POST`
- **Path:** `/api/v1/images`
- **Operation ID:** `image_generate_api_v1_images_post`
- **Tags:** Images

Start generating images from a prompt.

One generation runs at a time. Poll `GET /api/v1/images/{generation_id}` for progress and finished images.
Returns 409 while another generation or a GPU job is running.

## Effective servers

- `http://127.0.0.1:8100`

  Voice Creator Pro on this computer

## Request body

**Required:** `true`

**Content type:** `application/json`

schema: `ImageGenerateRequest`

- **`model_id` (required)**: `string`, maxLength: `64`

  Image model, from GET /api/v1/images/models
- **`prompt` (required)**: `string`, minLength: `1`, maxLength: `2000`

  What to draw
- **`aspect`**: `string | null`, possible values: `"9:16", "16:9", "1:1"`

  Image shape. Defaults to the model's size
- **`count`**: `integer | null`, minimum: `1`, maximum: `8`

  Number of images. Defaults to the model's images value
- **`guidance`**: `number | null`, minimum: `0`, maximum: `20`

  Prompt guidance, within the model's guidance\_range. Defaults to the model's guidance
- **`negative_prompt`**: `string | null`, maxLength: `2000`

  What to avoid. Only for models whose negative\_prompt is true
- **`seed`**: `integer | null`, minimum: `0`, maximum: `2147483647`

  Seed for the first image. Each next image uses the next seed
- **`steps`**: `integer | null`, minimum: `1`, maximum: `100`

  Sampling steps, within the model's steps\_range. Defaults to the model's steps

**Example:**

```json
{
  "model_id": "",
  "prompt": "",
  "negative_prompt": "",
  "count": 1,
  "aspect": "9:16",
  "seed": 0,
  "steps": 1,
  "guidance": 0
}
```

## Responses

### 200 Successful Response

**Content type:** `application/json`

`any`

**Example:**

```json
null
```

### 422 Validation Error

**Content type:** `application/json`

schema: `HTTPValidationError`

- **`detail`**: `array`

  **Items:**

  schema: `ValidationError`
  - **`loc` (required)**: `array of (string | integer)`
  - **`msg` (required)**: `string`
  - **`type` (required)**: `string`
  - **`ctx`**: `object`
  - **`input`**: `any`

**Example:**

```json
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": null,
      "ctx": {}
    }
  ]
}
```

## Schemas

- `HTTPValidationError` — shown above.
- `ImageGenerateRequest` — shown above.
- `ValidationError` — shown above.
