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

# Seedream Image Generation 4.0

Seedream 4.0 is an advanced image generation model that provides flexible image creation capabilities, including support for 4K resolution and generating images from text and other images.

## Request Headers

<ParamField header="Content-Type" type="string" required={true}>
  Enum value: `application/json`
</ParamField>

<ParamField header="Authorization" type="string" required={true}>
  Bearer authentication format: Bearer \{\{API Key}}.
</ParamField>

## Request Body

<ParamField body="prompt" type="string" required={true}>
  The prompt used to generate the image. Chinese and English are supported.

  It is recommended to use no more than 300 Chinese characters or 600 English words. If the text is too long, the information may become scattered, and the model may ignore details and focus only on the main points, causing some elements to be missing from the image.
</ParamField>

<ParamField body="images" type="string[]" required={false}>
  The Base64 encoding or accessible URL of the image to be edited. You can input one or more images.

  * Image URL: Ensure the image URL is accessible.
  * Base64 encoding: The format must be `data:image/<图像格式>;base64,<Base64 编码>`.<br />

    Input images must meet the following requirements:

    * Image formats: jpeg, png
    * Aspect ratio (width/height): range \[1/3, 3]
    * Width and height (pixels): > 14
    * Size: no more than 10 MB
    * Total pixels: no more than `6000×6000` PX
    * Supports uploading up to 10 reference images.
</ParamField>

<ParamField body="size" type="string" required={false}>
  Set the specifications of the generated image. There are two available methods, but they cannot be used at the same time.

  * Method 1: Specify the resolution.
    * Optional values: `1K`, `2K`, `4K`
  * Method 2: Specify the width and height (pixels) of the generated image.
    * Default value: `2048x2048`
    * Total pixel range: `[1024x1024, 4096x4096]`
    * Aspect ratio range: `[1/16, 16]`

  Recommended width and height:

  | Aspect Ratio | Width and Height in Pixels |
  | ------------ | -------------------------- |
  | 1:1          | 2048x2048                  |
  | 4:3          | 2304x1728                  |
  | 3:4          | 1728x2304                  |
  | 16:9         | 2560x1440                  |
  | 9:16         | 1440x2560                  |
  | 3:2          | 2496x1664                  |
  | 2:3          | 1664x2496                  |
  | 21:9         | 3024x1296                  |
</ParamField>

<ParamField body="sequential_image_generation" type="string" required={false} default="disabled">
  Controls whether batch generation is disabled.

  * `auto`: In automatic mode, the model automatically decides whether to return multiple images and how many images to include based on the user's prompt.
  * `disabled`: Disables batch generation. The model will generate only one image.
</ParamField>

<ParamField body="max_images" type="integer" required={false} default={15}>
  Specifies the maximum number of images to generate in this request. This parameter is only valid when `sequential_image_generation` is set to `auto`.

  Value range: `[1, 15]`

  <Tip>
    Note

    The actual number of generated images is affected by `max_images` and the number of input reference images. Number of input reference images + number of generated images ≤ 15.
  </Tip>
</ParamField>

<ParamField body="watermark" type="boolean" required={false} default={true}>
  Add a watermark to the generated image.

  * `false`: Do not add a watermark.
  * `true`: Add a watermark with the text "AI generated" in the lower-right corner of the image.
</ParamField>

## Response Information

<ResponseField name="images" type="string[]" required={false}>
  An array containing download links for the generated images.
</ResponseField>
