# Seedream Image Generation

> Seedream image generation source documentation.

Canonical URL: https://docs.uniall.ai/models/image/seedream
Locale: en

this page Seedream image generation model, image model Endpoint, Parameters, constraints, responsesandExample.

## Basic Information

### Authentication

All `/v1/*` endpoints require an API key:

```http
Authorization: Bearer <your_api_key>
```

### supports Model

| Public model | Capability | Billing basis |
|---|---|---:|
| `seedream-4.0` |, image editing | image |
| `seedream-4.5` |, image editing | image |
| `seedream-5.0-lite` |, image editing | image |

 Model name supports andimage editing:

| | OperationType |
|---|---|
| passreference | |
| pass `image`/`image_url`/`image_urls`/`images` | image editing |

> billing detail recommended: image billing detail. `custom_size`, Landscape, Portrait, Ratio billing detail.

## recommended

| scenario | Endpoint | result | return |
|---|---|---:|---|
|, synchronous | `POST /v1/images/generations`| Yes |`data[].url` |
| image editing, synchronous | `POST /v1/images/edits`| Yes |`data[].url` |

## Parameters

### supported parameters

| Parameters | Type | | Required | Note |
|---|---|---|---:|---|
| `model`| string | body | Yes |`seedream-4.0`, `seedream-4.5`, `seedream-5.0-lite` |
| `prompt` | string | body | Yes | oreditingprompt |
| `n`| integer | body | No | image,`1` `6`. OpenAI compatibility field |
| `custom_size`| object | body | No | size,`{"width": 2048, "height": 2048}` |
| `image` | string / array | body / form | required for editing | reference URL, pass or |
| `image_url`| string / object / array | body / form | required for editing | reference URL, compatibility `{"url": "..."}` |
| `image_urls` | array | body / form | required for editing | multiple reference images URL |
| `images` | array | body | required for editing | multiple reference images URL, supportsstringorobject |
| `timeout_seconds` | integer | body | No | synchronousEndpoint |

### `n`

- defaultvalue: `1`
- value: `1`
- value: `6`

Example:

```json
{
  "num_images": 3
}
```

or:

```json
{
  "n": 3
}
```

## `custom_size` sizeRules

format:

```json
{
  "custom_size": {
    "width": 2048,
    "height": 2048
  }
}
```

sizeconstraints:

| Model | | | | Whether 16 |
|---|---:|---:|---:|---:|
| `seedream-4.0`|`921600`|`16777216`|`4096` | No |
| `seedream-4.5`|`3686400`|`16777216`|`4096` | No |
| `seedream-5.0-lite`|`3686400`|`16777216`|`4096` | No |

 size:

| size | Ratio | `seedream-4.0`|`seedream-4.5`|`seedream-5.0-lite` |
|---|---|---:|---:|---:|
| `960x960`|`1:1` | | unavailable, below the minimum pixel size | unavailable, below the minimum pixel size |
| `1280x720`|`16:9` | | unavailable, below the minimum pixel size | unavailable, below the minimum pixel size |
| `720x1280`|`9:16` | | unavailable, below the minimum pixel size | unavailable, below the minimum pixel size |
| `2048x2048`|`1:1` | | | |
| `2560x1440`|`16:9` | | | |
| `1440x2560`|`9:16` | | | |
| `2304x1728`|`4:3` | | | |
| `1728x2304`|`3:4` | | | |
| `4096x4096`|`1:1` |, |, |, |

## reference

image editingmode supports URL reference. does not support pass file.:

```json
{
  "image": "https://example.com/a.png"
}
```

```json
{
  "image_url": "https://example.com/a.png"
}
```

```json
{
  "image_url": {
    "url": "https://example.com/a.png"
  }
}
```

```json
{
  "image_urls": [
    "https://example.com/a.png",
    "https://example.com/b.png"
  ]
}
```

```json
{
  "images": [
    "https://example.com/a.png",
    {
      "url": "https://example.com/b.png"
    },
    {
      "image_url": "https://example.com/c.png"
    }
  ]
}
```

editingconstraints:

| constraints | value |
|---|---:|
| reference up to | `10` |
| up to | `6` |
| + up to | `15` |

Example:

| reference | `num_images` |
|---:|---:|
| `1`|`6` |
| `5`|`6` |
| `9`|`6` |
| `10`|`5` |


## synchronous

###

```bash
curl -X POST "$BASE_URL/v1/images/generations" \
 -H "Authorization: Bearer $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"model": "seedream-4.0",
 "prompt": "one, and "}'
```

responses:

```json
{
  "created": 1778688000,
  "data": [
    {
      "url": "https://example.com/generated-1.png"
    }
  ]
}
```

### generation 6

```bash
curl -X POST "$BASE_URL/v1/images/generations" \
 -H "Authorization: Bearer $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"model": "seedream-4.5",
 "prompt": ", ",
 "num_images": 6,
 "custom_size": {"width": 2048,
 "height": 2048}}'
```

### 16:9 Landscape

`seedream-4.5` and `seedream-5.0-lite`, recommended `2560x1440`:

```bash
curl -X POST "$BASE_URL/v1/images/generations" \
 -H "Authorization: Bearer $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"model": "seedream-5.0-lite",
 "prompt": "16:9, ",
 "n": 2,
 "custom_size": {"width": 2560,
 "height": 1440}}'
```

### 9:16 Portrait

```bash
curl -X POST "$BASE_URL/v1/images/generations" \
 -H "Authorization: Bearer $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"model": "seedream-4.5",
 "prompt": "Portrait, ",
 "num_images": 1,
 "custom_size": {"width": 1440,
 "height": 2560}}'
```

### `seedream-4.0` sizeExample

`1280x720` `seedream-4.0`, `seedream-4.5` and `seedream-5.0-lite`.

```bash
curl -X POST "$BASE_URL/v1/images/generations" \
 -H "Authorization: Bearer $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"model": "seedream-4.0",
 "prompt": "Landscape, ",
 "custom_size": {"width": 1280,
 "height": 720}}'
```

## synchronousimage editing

### JSON reference

```bash
curl -X POST "$BASE_URL/v1/images/edits" \
 -H "Authorization: Bearer $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"model": "seedream-4.0",
 "prompt": "change image into style, reserved subject ",
 "image": "https://example.com/source.png",
 "num_images": 1,
 "custom_size": {"width": 2048,
 "height": 2048}}'
```

### JSON multiple reference images

```bash
curl -X POST "$BASE_URL/v1/images/edits" \
 -H "Authorization: Bearer $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"model": "seedream-4.5",
 "prompt": " reference, ",
 "image_urls": ["https://example.com/product.png",
 "https://example.com/background.png"],
 "n": 3,
 "custom_size": {"width": 2560,
 "height": 1440}}'
```

### `images` arrayobject

```bash
curl -X POST "$BASE_URL/v1/images/edits" \
 -H "Authorization: Bearer $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"model": "seedream-5.0-lite",
 "prompt": "reference one and, generationone style ",
 "images": [{"url": "https://example.com/person.png"},
 {"image_url": "https://example.com/outfit.png"}],
 "num_images": 2,
 "custom_size": {"width": 2048,
 "height": 2048}}'
```
