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

# Seedream 5.0 Pro 图层拆分

> - Seedream 5.0 Pro 图层拆分 (doubao-seedream-5.0-pro-layerize) 把一张图片拆成底图与多个独立图层，每个图层是带透明通道的 PNG，底图格式由 `output_format` 决定
- 输入必须**恰好 1 张**图片；`prompt` 选填，不传即由模型自动识别画面中所有主要元素逐一拆分
- 输出张数由拆分结果决定（`1` ~ `17` 张），不受请求参数控制；任一图层失败则整单失败，不存在部分成功，失败会全额退款
- 异步处理模式，使用返回的任务ID  [进行查询](/cn/api-manual/task-management/get-task-detail)。任务详情的 `result_data` 中，每张图片附带 `z_index`（叠放顺序，底图为 `0`，图层从 `1` 递增），图层还带 `bounding_box`（`absolute` 为底图坐标系的像素坐标，`normalized` 值域 `0`~`1000`）、`name` 与 `description`
- 本模型耗时较长，预估约 `120` 秒
- 生成的图像链接，有效期为24小时，请尽快保存



## OpenAPI

````yaml cn/api-manual/image-series/seedream/seedream-5.0-pro-layerize-image-generate.json POST /v1/images/generations
openapi: 3.1.0
info:
  title: doubao-seedream-5.0-pro-layerize接口
  description: 使用 Seedream 5.0 Pro 图层拆分模型，把一张图片拆成底图与多个可编辑图层
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 生产环境
security:
  - bearerAuth: []
tags:
  - name: 图像生成
    description: AI图像生成相关接口
paths:
  /v1/images/generations:
    post:
      tags:
        - 图像生成
      summary: doubao-seedream-5.0-pro-layerize接口
      description: >-
        - Seedream 5.0 Pro 图层拆分 (doubao-seedream-5.0-pro-layerize)
        把一张图片拆成底图与多个独立图层，每个图层是带透明通道的 PNG，底图格式由 `output_format` 决定

        - 输入必须**恰好 1 张**图片；`prompt` 选填，不传即由模型自动识别画面中所有主要元素逐一拆分

        - 输出张数由拆分结果决定（`1` ~ `17` 张），不受请求参数控制；任一图层失败则整单失败，不存在部分成功，失败会全额退款

        - 异步处理模式，使用返回的任务ID 
        [进行查询](/cn/api-manual/task-management/get-task-detail)。任务详情的
        `result_data` 中，每张图片附带 `z_index`（叠放顺序，底图为 `0`，图层从 `1` 递增），图层还带
        `bounding_box`（`absolute` 为底图坐标系的像素坐标，`normalized` 值域 `0`~`1000`）、`name`
        与 `description`

        - 本模型耗时较长，预估约 `120` 秒

        - 生成的图像链接，有效期为24小时，请尽快保存
      operationId: createSeedreamLayerizeImageGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
            examples:
              auto_layerize:
                summary: 自动拆分（不传 prompt）
                value:
                  model: doubao-seedream-5.0-pro-layerize
                  image_urls:
                    - https://example.com/poster.png
                  quality: auto
                  output_format: jpeg
              prompt_layerize:
                summary: 自然语言指定要拆的元素
                value:
                  model: doubao-seedream-5.0-pro-layerize
                  prompt: 把鹦鹉和标题文字拆出来
                  image_urls:
                    - https://example.com/poster.png
                  quality: 2K
              bbox_layerize:
                summary: 用 bbox 坐标精确指定
                value:
                  model: doubao-seedream-5.0-pro-layerize
                  prompt: >-
                    标题文字<bbox>179 58 809 197</bbox>、1只鹦鹉<bbox>330 274 641
                    991</bbox>
                  image_urls:
                    - https://example.com/poster.png
                  quality: 1.5K
      responses:
        '200':
          description: 图像生成任务创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未认证、Token无效或过期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: 配额不足、需要充值
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: 无权限访问
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: >-
                    Token does not have access to model:
                    doubao-seedream-5.0-pro-layerize
                  type: invalid_request_error
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - model
        - image_urls
      properties:
        model:
          type: string
          description: 图像生成模型名称
          enum:
            - doubao-seedream-5.0-pro-layerize
          default: doubao-seedream-5.0-pro-layerize
          example: doubao-seedream-5.0-pro-layerize
        image_urls:
          type: array
          description: >-
            待拆分的图片 URL（必填）


            **注意：**

            - **必须恰好 `1` 张**，不传或传 `2` 张及以上都会报错

            - 支持的图像格式：`.png`、`.jpeg`、`.jpg`（比普通生成更严格，webp 等格式会被拒绝）

            - 图像大小：不超过 `30MB`

            - 总像素范围：`[262144, 6000×6000]`，即最低 `512×512`（下限高于普通生成）

            - 宽高比（宽/高）范围：`[1/16, 16]`

            -
            图像URL需要服务器能直接查看，或者图像URL在访问时会直接进行下载（一般这种URL是以图像的扩展名作为结尾，例如`.png`、`.jpg`）
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 1
          example:
            - https://example.com/poster.png
        prompt:
          type: string
          description: >-
            指定要拆分的元素（选填）


            **三种用法：**

            - **不传**：模型自动识别画面中所有主要元素并逐一拆分

            - **自然语言**：如 `把鹦鹉和标题文字拆出来`，按语义识别并分层

            - **坐标精准**：用 `<bbox>` 标签指定位置，如 `标题文字<bbox>179 58 809
            197</bbox>`，推荐使用归一化坐标（`0`~`1000`）
          example: 把鹦鹉和标题文字拆出来
        quality:
          type: string
          description: >-
            输出档位，默认 `auto`


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


            **说明：**

            - 图层模式**只接受档位**，传比例（如 `16:9`）或像素（如 `2048x2048`）会报错

            - `auto` 表示输出跟随输入图：原始尺寸落在 `[921600, 4624220]` 像素区间内按原尺寸输出，小于 1K 按 1K
            输出，大于 2K 按 2K 输出

            - 每个图层各自保持它在原图中的宽高比，底图的宽高比与输入图一致


            **计费说明：** 按每张输出图各自的像素判档，`1K` 与 `1.5K` 同价；单张输出总像素超过 `2610000` 走高档价。
          enum:
            - auto
            - 1K
            - 1.5K
            - 2K
          default: auto
          example: auto
        prompt_priority:
          type: string
          description: |-
            提示词优化策略，用于设置提示词优化功能的模式

            **可选值：**
            - `standard`：标准模式，生成内容质量更高，耗时较长
            - `fast`：快速模式，生成耗时更短，效果略低于标准模式
          enum:
            - standard
            - fast
          default: standard
          example: standard
        output_format:
          type: string
          description: |-
            输出图片格式

            **可选值：**
            - `jpeg`: JPEG 格式（默认）
            - `png`: PNG 格式

            **注意：** 该参数**仅控制底图**，拆分出的图层固定为带透明通道的 png，不受此参数影响。
          enum:
            - jpeg
            - png
          default: jpeg
          example: jpeg
        callback_url:
          type: string
          description: |-
            任务完成后的HTTPS回调地址

            **回调时机：**
            - 任务完成（completed）、失败（failed）或取消（cancelled）时触发
            - 在计费确认完成后发送

            **安全限制：**
            - 仅支持HTTPS协议
            - 禁止回调到内网IP地址（127.0.0.1、10.x.x.x、172.16-31.x.x、192.168.x.x等）
            - URL长度不超过`2048`字符

            **回调机制：**
            - 超时时间：`10`秒
            - 失败后最多重试`3`次（会分别在失败的`1`秒/`2`秒/`4`秒后进行重试）
            - 回调响应体格式与任务查询接口返回的格式一致
            - 回调地址若返回2xx状态码视为成功，其他状态码会触发重试
          format: uri
          example: https://your-domain.com/webhooks/image-task-completed
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: 任务创建时间戳
          example: 1757165031
        id:
          type: string
          description: 任务ID
          example: task-unified-1757165031-seedream5prolayerize
        model:
          type: string
          description: 实际使用的模型名称
          example: doubao-seedream-5.0-pro-layerize
        object:
          type: string
          enum:
            - image.generation.task
          description: 任务的具体类型
        progress:
          type: integer
          description: 任务进度百分比 (0-100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: 任务状态
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          $ref: '#/components/schemas/TaskInfo'
          description: 异步任务信息
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          description: 任务的输出类型
          example: image
        usage:
          $ref: '#/components/schemas/Usage'
          description: 使用量和计费信息
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: 错误代码标识符
            message:
              type: string
              description: 错误描述信息
            type:
              type: string
              description: 错误类型
    TaskInfo:
      type: object
      properties:
        can_cancel:
          type: boolean
          description: 任务是否可以取消
          example: true
        estimated_time:
          type: integer
          description: 预估完成时间（秒）
          minimum: 0
          example: 120
    Usage:
      type: object
      description: 使用量和计费信息
      properties:
        billing_rule:
          type: string
          description: 计费规则
          enum:
            - per_call
            - per_token
            - per_second
          example: per_call
        credits_reserved:
          type: number
          description: 预估消耗积分数
          minimum: 0
          example: 39.168
        user_group:
          type: string
          description: 用户组类别
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##所有接口均需要使用Bearer Token进行认证##

        **获取 API Key ：**

        访问 [API Key 管理页面](https://evolink.ai/dashboard/keys) 获取您的 API Key

        **使用时在请求头中添加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````