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

# Seedream 5.0 Pro 图生图

> 支持模型包括 `dola-seedream-5-0-pro-260628`。本文档覆盖图生图、多图参考生成与分层解析场景。公开字段包括 `model`、`prompt`、`image`、`size`、`background`、`layer_decomposition`、`response_format`、`watermark`。

**模型能力**
- 生成单图（不支持配置 sequential_image_generation）
- 分层解析：支持将单张图片分解为 1 张底图与多个输出图层（最多 16 层）。
- 交互编辑：支持通过坐标、选框、箭头等多种方式精准指定编辑位置。
- 多图生图：输入多张参考图片（2-10）+ 文本提示词，生成单张图片。
- 单图生图：输入单张参考图片 + 文本提示词，生成单张图片。
- 暂不支持组图生成、联网搜索、流式输出。



## OpenAPI

````yaml api-reference/zh-Hans/zmodelImage/byteplus/seedream-5-0-pro-image-to-image.json POST /v1/images/generations
openapi: 3.0.1
info:
  title: Seedream 5.0 Pro 图生图
  version: 1.0.0
  description: Doubao Seedream 5.0 pro 图生图、多图参考与分层解析能力文档。公开统一入口为 `/v1/images/generations`。
  license:
    name: Project License
    url: https://github.com/QuantumNous/new-api/blob/main/LICENSE
servers:
  - url: https://baze-api.powerbuyin.top
    description: Baze API 服务地址
security: []
tags:
  - name: Seedream Image
    description: Seedream 系列图像生成能力
paths:
  /v1/images/generations:
    post:
      tags:
        - Seedream Image
      summary: Seedream 5.0 Pro 图生图
      description: >-
        支持模型包括 `dola-seedream-5-0-pro-260628`。本文档覆盖图生图、多图参考生成与分层解析场景。公开字段包括
        `model`、`prompt`、`image`、`size`、`background`、`layer_decomposition`、`response_format`、`watermark`。


        **模型能力**

        - 生成单图（不支持配置 sequential_image_generation）

        - 分层解析：支持将单张图片分解为 1 张底图与多个输出图层（最多 16 层）。

        - 交互编辑：支持通过坐标、选框、箭头等多种方式精准指定编辑位置。

        - 多图生图：输入多张参考图片（2-10）+ 文本提示词，生成单张图片。

        - 单图生图：输入单张参考图片 + 文本提示词，生成单张图片。

        - 暂不支持组图生成、联网搜索、流式输出。
      operationId: byteplusImageToImage50Pro
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageToImageRequest'
            examples:
              image_to_image:
                summary: 基础图生图
                value:
                  model: dola-seedream-5-0-pro-260628
                  prompt: 将图片转换为宫崎骏动画风格
                  image: https://example.com/input.jpg
                  size: 2K
              multi_image_reference:
                summary: 多图参考生成
                value:
                  model: dola-seedream-5-0-pro-260628
                  prompt: 结合这些图片的风格，生成一张新的风景图
                  image:
                    - https://example.com/ref1.jpg
                    - https://example.com/ref2.jpg
                  size: 2K
              layer_decomposition:
                summary: 分层解析
                value:
                  model: dola-seedream-5-0-pro-260628
                  prompt: 将图片主体与背景分离为独立图层
                  image: https://example.com/input.png
                  size: auto
                  layer_decomposition: true
      responses:
        '200':
          description: 调用成功，返回图像生成结果。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '400':
          description: 请求参数不合法。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_request:
                  summary: 参数错误
                  value:
                    error:
                      message: 请求体格式错误或字段取值非法
                      type: invalid_request_error
                      code: bad_request_body
                      param: ''
        '401':
          description: 鉴权失败，例如未提供令牌或令牌无效。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: 未授权
                  value:
                    error:
                      message: 无效的令牌
                      type: api_error
                      code: access_denied
                      param: ''
        '429':
          description: 触发速率限制或账户额度不足。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                quota_exceeded:
                  summary: 额度不足或速率受限
                  value:
                    error:
                      message: 当前账户额度不足，请稍后重试
                      type: api_error
                      code: insufficient_user_quota
                      param: ''
        '500':
          description: 服务端处理请求时发生内部错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  summary: 内部处理失败
                  value:
                    error:
                      message: 服务内部处理失败，请稍后重试
                      type: api_error
                      code: gen_relay_info_failed
                      param: ''
      security:
        - BearerAuth: []
components:
  schemas:
    ImageToImageRequest:
      type: object
      required:
        - model
        - prompt
        - image
      properties:
        model:
          type: string
          enum:
            - dola-seedream-5-0-pro-260628
          description: >-
            图像生成模型名称。支持的模型包括 `dola-seedream-5-0-pro-260628`（Seedream 5.0
            pro，支持交互编辑与分层解析，不支持组图生成）。
        prompt:
          type: string
          description: >-
            用于生成图像的提示词或分层意图描述，支持中英文。建议不超过 300 个汉字或 600
            个英文单词。字数过多信息容易分散，模型可能因此忽略细节，只关注重点，造成图片缺失部分元素。


            - **图像生成场景（必填）**：描述希望生成的内容。

            - **分层解析场景（可选）**：指定希望分层的意图。若不传，模型将自动识别图中主要元素并拆分为独立图层。
          example: 充满活力的特写编辑肖像，模特眼神犀利，头戴雕塑感帽子，色彩拼接丰富。
        image:
          oneOf:
            - type: string
              description: 输入的图片信息，支持 URL 或 Base64 编码。
            - type: array
              description: 输入的多张图片信息，支持 URL 或 Base64 编码。
              items:
                type: string
              maxItems: 10
          description: >-
            输入的图片信息，支持 URL 或 Base64 编码。


            - **图片 URL**：请确保图片 URL 可被访问。

            - **Base64 编码**：请遵循此格式 `data:image/<图片格式>;base64,<Base64编码>`。注意
            `<图片格式>` 需小写，如 `data:image/png;base64,<base64_image>`。


            **图像生成场景（可选）**：

            - Seedream 5.0 pro 最多支持传入 10 张参考图。

            - 传入单张图片要求：
              - 图片格式：jpeg、png、webp、bmp、tiff、gif、heic、heif
              - 宽高比（宽/高）范围：[1/16, 16]
              - 宽高长度（px） > 14
              - 大小：不超过 30MB
              - 总像素：不超过 6000×6000 = 36000000 px（对单张图宽度和高度的像素乘积限制，而不是对宽度或高度的单独值进行限制）

            **分层解析场景（必填）**：

            - 当开启分层解析模式（`layer_decomposition` 为 `true`）时，`image` 为必填项，且仅支持传入 1
            张待分层图片。传入多张图片会报错。

            - 传入单张图片要求：
              - 图片格式：png 或 jpeg
              - 宽高比：[1/16, 16]
              - 大小：不超过 30MB
              - 总像素（宽 × 高）：[`512×512` (262,144), `6000×6000` (36,000,000)]
        size:
          type: string
          description: >-
            指定生成图像的尺寸信息。不同场景下的配置方式和支持取值如下：


            **图像生成场景**

            支持以下两种方式，不可混用：


            * **方式 1（推荐）**：指定分辨率档位，并在 prompt
            中用自然语言描述图片宽高比、图片形状或图片用途，最终由模型判断生成图片的大小。
              * 默认值：`auto`
              * 可选值：`1K`、`1.5K`、`2K`
              * *计费说明*：`1.5K` 价格与 `1K` 相同，且能提供更高的出图质量。

            * **方式 2**：指定宽高像素值（宽x高）。
              * 总像素取值范围：[`1280x720`（921600）, `2048x2048×1.1025`（4624220）]
              * 宽高比取值范围：[1/16, 16]
              * *说明*：采用方式 2 时，需同时满足总像素取值范围和宽高比取值范围。其中，总像素是对单张图宽度和高度的像素乘积限制，而不是对宽度或高度的单独值进行限制。
                * 有效示例：`2048x1024`（总像素值 2048x1024=2097152，符合 [921600, 4624220]；宽高比 2048/1024=2，符合 [1/16, 16]，故有效）
                * 无效示例：`512x512`（总像素值 512x512=262144，未达 921600 最低要求，故无效）

            **方式 1 实际映射的宽高像素参考值**：


            | 分辨率 | 宽高比 | 宽高像素值 |

            |---|---|---|

            | 1K | 1:1 | 1024x1024 |

            | | 4:3 | 1152x864 |

            | | 3:4 | 864x1152 |

            | | 16:9 | 1424x800 |

            | | 9:16 | 800x1424 |

            | | 3:2 | 1248x832 |

            | | 2:3 | 832x1248 |

            | | 21:9 | 1568x672 |

            | 1.5K | 1:1 | 1536x1536 |

            | | 4:3 | 1792x1344 |

            | | 3:4 | 1344x1792 |

            | | 16:9 | 2048x1152 |

            | | 9:16 | 1152x2048 |

            | | 3:2 | 1872x1248 |

            | | 2:3 | 1248x1872 |

            | | 21:9 | 2352x1008 |

            | 2K | 1:1 | 2048x2048 |

            | | 4:3 | 2368x1776 |

            | | 3:4 | 1776x2368 |

            | | 16:9 | 2816x1584 |

            | | 9:16 | 1584x2816 |

            | | 3:2 | 2496x1664 |

            | | 2:3 | 1664x2496 |

            | | 21:9 | 3136x1344 |


            **分层解析场景**

            仅支持指定分辨率档位：

            * **底图**：输出底图分辨率与 `size` 指定档位一致，保持原图宽高比。

            * **图层**：每个图层分辨率贴近 `size` 指定档位，保持对应区域宽高比。

            * 默认值：`auto`

            * 可选值：`1K`、`1.5K`、`2K`、`auto`

            * **`auto` 自适应规则**：
              * 原图尺寸在 [`1280x720` (921600), `2048x2048x1.1025` (4624220)] 之间时，按原尺寸输出。
              * 小于 1K 则按 1K 输出。
              * 大于 2K 则按 2K 输出。
          default: auto
          example: auto
          x-enum:
            - 1K
            - 1.5K
            - 2K
            - auto
        background:
          type: string
          enum:
            - opaque
            - transparent
          description: |-
            控制是否生成带透明通道（Alpha 通道）的图片。可选值：
            - `opaque`：不透明背景模式（默认）。生成的图片为常规不透明背景。
            - `transparent`：透明背景模式。生成的图片为透明背景。

            **使用限制**：
            - 仅在单图生图且输入图片自带透明通道时支持该参数。
            - 在透明背景模式下，输出格式默认为 `png`；若将 `output_format` 设为 `jpeg`，请求将报错。
            - 若输入图片格式不支持透明通道（如 `jpeg`），请求将报错。

            **支持模型**：`dola-seedream-5-0-pro-260628`（Seedream 5.0 pro）。
          default: opaque
        layer_decomposition:
          type: boolean
          description: >-
            控制是否开启图层分解。将单张图片中的主体、背景、文字等内容自动分解为 1 张底图与最多 16
            个可独立编辑的图层（每个图层均为带透明通道的 PNG 图片）。

            - `true`：开启分层解析模式。模型将输入图片分解为底图与多个图层。

            - `false`：图像生成模式（默认）。不进行分层解析。


            **使用注意事项**：

            - 开启分层解析时，`image` 为必填项且仅支持传入单张图片。传入多张图片会报错。

            - 若任意图层生成失败，整次请求将失败，不支持部分成功。

            - 若提示词要求图层数超过上限（16层），可能会丢失部分图层信息。

            - `data`
            响应对象中将返回每个图层的层级顺序（`z_index`）、边界框坐标（`bounding_box`）、图层名称（`name`）及描述（`description`）。


            **支持模型**：`dola-seedream-5-0-pro-260628`（Seedream 5.0 pro）。
          default: false
        response_format:
          type: string
          enum:
            - url
            - b64_json
          description: |-
            指定生成图像的返回格式。支持以下两种返回方式：
            - `url`：返回图片下载链接；链接在图片生成后 24 小时内有效，请及时下载图片。
            - `b64_json`：以 Base64 编码字符串的 JSON 格式返回图像数据。
          default: url
        watermark:
          type: boolean
          description: |-
            是否在生成的图片中添加水印。
            - `false`：不添加水印。
            - `true`：在图片右下角添加「AI生成」字样的水印标识。
          default: true
    ImageGenerationResponse:
      type: object
      properties:
        model:
          type: string
          description: 本次请求使用的模型 ID（模型名称-版本）。
        created:
          type: integer
          format: int64
          description: 创建时间的 Unix 时间戳（秒）。
        data:
          type: array
          items:
            $ref: '#/components/schemas/ImageData'
          description: 生成的图像列表。在分层解析场景下包含底图与各图层。
        usage:
          type: object
          description: 本次请求的用量信息。
          properties:
            generated_images:
              type: integer
              description: 模型成功生成的图片张数，不包含生成失败的图片。
            input_images:
              type: integer
              description: 输入模型的图片张数。
            output_tokens:
              type: integer
              description: 模型生成的图片花费的 token 数量。
            total_tokens:
              type: integer
              description: 本次请求消耗的总 token 数量。
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
    ImageData:
      type: object
      properties:
        url:
          type: string
          description: 图片下载链接。有效期 24 小时，请及时保存。
        b64_json:
          type: string
          description: Base64 编码的图片数据。
        size:
          type: string
          description: 图像尺寸（宽x高）。
        output_format:
          type: string
          description: 输出图像格式（`png` 或 `jpeg`）。在分层解析场景下，底图格式由该字段控制，图层固定为 `png`。
        z_index:
          type: integer
          description: 图层堆叠顺序索引（分层解析场景返回）。底图固定为 `0`，图层从 `1` 开始递增。
        name:
          type: string
          description: 图层名称或标识（分层解析场景返回），用于标识图层主体内容。
        description:
          type: string
          description: 图层详细语义描述（分层解析场景返回）。
        bounding_box:
          type: object
          description: 图层在输出底图坐标系中的边界框信息（分层解析场景图层返回）。
          properties:
            absolute:
              type: array
              items:
                type: integer
              description: 在输出底图坐标系下的绝对像素坐标 `[left, top, right, bottom]`。
            normalized:
              type: array
              items:
                type: integer
              description: 归一化坐标 `[left, top, right, bottom]`，取值范围 `[0, 1000]`。
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '在请求头中传入 `Authorization: Bearer <token>`。'

````