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

> ## Agent Instructions
> Send API requests to https://api.ttapi.io with the TT-API-KEY header. Midjourney account hosting uses https://hold.ttapi.io. Claude Code uses https://cc.ttapi.io.
> Most generation endpoints are asynchronous. The submit response returns a job id. Poll that product's fetch endpoint, or pass a webhook on the submit request. A fetch call does not start a new generation.
> 1 USD = 100 quota. Check the pricing page for that product before estimating cost.
> This file lists the English docs. Follow every /_llms/ link recursively for the API reference, Chinese, and Russian. Open a page's .md URL for the endpoint schema.

# 图层拆分

> 图层拆分 - 提交异步图片生成任务，返回 id

这是 **Seedream 图片生成 API** 的图层拆分接口。将单张图片拆解为底图（1 张）+ 多个图层输出（最多 16 个图层）。仅 Seedream 5.0 pro / flash 支持。提交异步任务后返回 `id`，需通过查询接口获取结果。

**使用方式**：在 `prompt` 中使用 `<bbox>` 坐标标注需要拆分的区域，设置 `layer_decomposition: true` 开启图层拆分模式。


## OpenAPI

````yaml openapi/cn/seedream-layer-decomposition.json POST /sd/api/v3/images/generations/tasks
openapi: 3.1.0
info:
  title: Seedream - 图层拆分
  version: 1.0.0
  description: Seedream 图层拆分接口 - 将单张图片拆解为底图和多个图层。仅 Seedream 5.0 pro / flash 支持。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /sd/api/v3/images/generations/tasks:
    post:
      description: 图层拆分 - 提交异步图片生成任务，返回 id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LayerDecompositionRequest'
            example:
              model: doubao-seedream-5-0-pro-260628
              prompt: 将人物从背景中分离出来 <bbox>(0.1, 0.2, 0.8, 0.9)
              image: https://example.com/photo.jpg
              layer_decomposition: true
              watermark: false
      responses:
        '200':
          description: 任务提交成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: PENDING_QUEUE
                    description: 任务状态
                  message:
                    type: string
                    example: success
                  id:
                    type: string
                    description: 任务 ID
                    example: 30d9b07d-7349-4cbc-8e11-9ba302c6d165
                required:
                  - status
                  - message
                  - id
      security:
        - CustomApiKey: []
components:
  schemas:
    LayerDecompositionRequest:
      type: object
      description: 图层拆分请求参数
      properties:
        model:
          type: string
          description: 模型名称。
          enum:
            - doubao-seedream-5-0-pro-260628
            - doubao-seedream-5-0-flash-260915
        prompt:
          type: string
          description: 文本提示词，使用 <bbox> 坐标标注需要拆分的区域。
        image:
          type: string
          description: 待拆分的图片 URL。
        layer_decomposition:
          type: boolean
          description: >-
            是否开启图层拆分模式。true=图层拆分，将输入图拆解为底图和多个图层（最多 16 个）；false=图片生成模式。仅 Seedream
            5.0 pro/flash 支持。
          default: false
          enum:
            - true
            - false
        size:
          type: string
          description: 图像尺寸。图层拆分场景可选：1K、1.5K、2K、auto（默认 auto，自动保持与输入图一致）。不支持指定像素值。
          default: auto
          enum:
            - 1K
            - 1.5K
            - 2K
            - auto
        output_format:
          type: string
          description: 输出图像格式。图层拆分场景下仅控制底图格式，图层始终以 png 输出。
          default: jpeg
          enum:
            - png
            - jpeg
        response_format:
          type: string
          description: 返回格式。
          default: url
          enum:
            - url
            - b64_json
        watermark:
          type: boolean
          description: 是否添加水印。true=右下角显示「AI 生成」，false=不添加。
          default: true
          enum:
            - true
            - false
          example: false
        optimize_prompt_options:
          type: object
          description: 提示词优化配置
          properties:
            mode:
              type: string
              enum:
                - standard
                - fast
              default: standard
              description: 优化模式。standard=标准模式（质量更高，耗时较长），fast=快速模式（耗时更短，效果略低，5.0 flash 不支持）
        execution_expires_after:
          type: integer
          default: 172800
          description: 任务超时阈值（秒）。范围 [3600, 259200]（1~72 小时），默认 172800（48 小时）
        priority:
          type: integer
          default: 0
          description: 执行优先级。范围 [0, 9]，数值越大优先级越高，默认 0（FIFO）
        safety_identifier:
          type: string
          description: 终端用户唯一标识符，不超过 64 字符。建议传入哈希处理后的字符串
      required:
        - model
        - prompt
        - image
        - layer_decomposition
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.