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

# Seedream 5.0 Flash

> 使用 Seedream 5.0 Flash 生成、编辑、融合图片，保留透明背景，并将图片拆分为可编辑图层。

Seedream 5.0 Flash 是 ByteDance 面向速度和成本敏感场景的图片生成与编辑模型。使用模型 ID `doubao-seedream-5-0-flash-260915` 调用 AnyFast 的 `POST /v1/images/generations` 接口。上游模型支持文生图、单图和多图编辑、透明背景编辑以及图层拆分。

<Warning>Seedream 5.0 Flash 的普通生成请求每次只输出 1 张图片，不支持组图生成、联网搜索和流式输出。请勿传入 `sequential_image_generation`、`sequential_image_generation_options`、`tools` 或 `stream`。</Warning>

## 核心能力

* **文生图** — 根据文本提示词生成一张图片
* **图片编辑与融合** — 编辑单张参考图，或融合最多 10 张参考图中的内容和风格
* **交互编辑** — 通过自然语言、标记、点、边界框、箭头或草图指定编辑区域
* **透明背景** — 在单图编辑流程中保留 Alpha 透明通道
* **图层拆分** — 将一张图片拆分为底图和最多 16 个可独立编辑的透明 PNG 图层
* **多语言文字** — 除中英文外，还支持俄语、阿拉伯语、菲律宾语、泰语、土耳其语、韩语、马来语、西班牙语、葡萄牙语、印尼语、法语、德语、越南语和日语提示词

<Tabs sync={false}>
  <Tab title="文生图">
    ## 根据文本生成图片

    <CodeGroup>
      ```bash cURL theme={null}
      curl https://www.anyfast.ai/v1/images/generations \
        -H "Authorization: Bearer YOUR_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "doubao-seedream-5-0-flash-260915",
          "prompt": "一只白色陶瓷杯放在浅灰色背景上，居中构图，柔和阴影，产品摄影，无文字",
          "size": "1.5K",
          "response_format": "url",
          "output_format": "jpeg",
          "watermark": false
        }'
      ```

      ```python Python theme={null}
      import requests

      response = requests.post(
          "https://www.anyfast.ai/v1/images/generations",
          headers={
              "Authorization": "Bearer YOUR_API_KEY",
              "Content-Type": "application/json",
          },
          json={
              "model": "doubao-seedream-5-0-flash-260915",
              "prompt": "一只白色陶瓷杯放在浅灰色背景上，居中构图，柔和阴影，产品摄影，无文字",
              "size": "1.5K",
              "response_format": "url",
              "output_format": "jpeg",
              "watermark": False,
          },
      )

      print(response.json())
      ```
    </CodeGroup>

    `size` 支持 `1K`、`1.5K`、`2K` 或合法的 `宽x高` 像素值。Flash 仅支持 `standard` 提示词优化模式，请勿传入 `optimize_prompt_options.mode: "fast"`。
  </Tab>

  <Tab title="图片编辑">
    ## 编辑或融合参考图

    ```bash cURL theme={null}
    curl https://www.anyfast.ai/v1/images/generations \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedream-5-0-flash-260915",
        "prompt": "使用图 1 的构图，并采用图 2 的视觉风格。",
        "image": [
          "https://example.com/composition.png",
          "https://example.com/style.png"
        ],
        "size": "1K",
        "output_format": "jpeg",
        "watermark": false
      }'
    ```

    `image` 支持图片 URL、Base64 Data URI，或最多 10 张参考图组成的数组。在提示词中可按照数组顺序使用“图 1”“图 2”等名称引用图片。

    坐标编辑使用 1000 × 1000 归一化坐标系：

    ```json 坐标编辑 theme={null}
    {
      "model": "doubao-seedream-5-0-flash-260915",
      "prompt": "将图 1 中 <bbox>179 283 796 986</bbox> 的主体放入图 2 的 <bbox>118 331 933 871</bbox> 区域。",
      "image": [
        "https://example.com/source.png",
        "https://example.com/target.png"
      ],
      "size": "2K",
      "output_format": "png"
    }
    ```
  </Tab>

  <Tab title="透明背景">
    ## 保留透明通道

    ```bash cURL theme={null}
    curl https://www.anyfast.ai/v1/images/generations \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedream-5-0-flash-260915",
        "prompt": "保留主体并优化边缘，同时保持透明背景。",
        "image": "https://example.com/transparent-source.png",
        "background": "transparent",
        "size": "1K",
        "output_format": "png",
        "watermark": false
      }'
    ```

    透明模式仅适用于图生图，且必须只输入 1 张本身带有 Alpha 通道的图片。请使用 `output_format: "png"`；JPEG 输入或输出均不支持透明通道。
  </Tab>

  <Tab title="图层拆分">
    ## 将图片拆分为图层

    ```bash cURL theme={null}
    curl https://www.anyfast.ai/v1/images/generations \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedream-5-0-flash-260915",
        "prompt": "将绿色叶子图标从白色背景中拆分为一个可编辑图层。",
        "image": "https://example.com/green-leaf.jpeg",
        "layer_decomposition": true,
        "size": "1K",
        "response_format": "url",
        "output_format": "jpeg",
        "watermark": false
      }'
    ```

    图层拆分仅接受 1 张 PNG 或 JPEG。返回 1 张底图和最多 16 个透明 PNG 图层。底图遵循 `output_format`，拆出的图层固定为 PNG，并返回 `z_index`、`bounding_box`、`name` 和 `description` 元数据。

    ```json 响应结构 theme={null}
    {
      "model": "dola-seedream-5-0-flash-260915",
      "created": 1792129605,
      "data": [
        {
          "url": "https://example.com/seedream-flash-layer-0.jpeg",
          "size": "1024x1024",
          "output_format": "jpeg",
          "z_index": 0
        },
        {
          "url": "https://example.com/seedream-flash-layer-1.png",
          "size": "662x855",
          "output_format": "png",
          "z_index": 1,
          "bounding_box": {
            "absolute": [
              305,
              251,
              729,
              800
            ],
            "normalized": [
              298,
              245,
              711,
              780
            ]
          },
          "name": "green leaf icon",
          "description": "Extract the complete green leaf icon with leaf blade, veins and petiole, no other background elements included"
        }
      ],
      "usage": {
        "input_images": 1,
        "generated_images": 2,
        "output_tokens": 8549,
        "total_tokens": 8549
      }
    }
    ```

    图层拆分时，`size` 支持 `auto`、`1K`、`1.5K` 或 `2K`，不支持自定义像素尺寸。任一目标图层生成失败时，整个请求会失败。
  </Tab>
</Tabs>

## 输出控制

| 参数 | 可选值 | 说明 |
| - | - | - |
| `size` | `1K`、`1.5K`、`2K` 或自定义像素 | 普通生成默认 `2K`；图层拆分还支持 `auto` |
| `response_format` | `url`、`b64_json` | URL 有效期为 24 小时，请及时保存 |
| `output_format` | `jpeg`、`png` | 默认 `jpeg`；透明输出和拆出的图层使用 PNG |
| `background` | `opaque`、`transparent` | `transparent` 仅适用于单张透明输入图流程 |
| `watermark` | `true`、`false` | 默认 `true` |
| `optimize_prompt_options.mode` | `standard` | 默认值。Flash 不支持 `fast` 模式。 |

## 尺寸与输入限制

普通生成使用自定义尺寸时，总像素数必须在 921,600 到 4,624,220 之间，宽高比必须在 `[1/16, 16]`。代表性尺寸包括：1K 的 `1024x1024`、1.5K 的 `1536x1536` 和 2K 的 `2048x2048`。

普通参考图支持 `jpeg`、`png`、`webp`、`bmp`、`tiff`、`gif`、`heic` 和 `heif`。单张图片小于 30 MB，宽高比在 `[1/16, 16]`，宽和高均大于 14 px，总像素数在 196 到 36,000,000 之间。

图层拆分仅接受 1 张 PNG 或 JPEG，总像素数在 512×512 到 6000×6000 像素之间，并遵循相同的宽高比和 30 MB 限制。

<Card title="API 参考" icon="code" href="/zh/api-reference/model-api/bytedance/doubao-seedream-5-0-flash-260915">查看 Seedream 5.0 Flash 的全部调用方式。</Card>

## 官方参考

* [Seedream 5.0 Pro / Flash 教程](https://docs.volcengine.com/docs/ark/seedream-5-0-pro?lang=zh)
* [图片生成 API](https://docs.volcengine.com/docs/ark/image-generation-api?lang=zh)
* [Seedream 模型能力对比](https://console.volcengine.com/ark/region:cn-beijing/docs/seedream-4-0-5-0)

<script src="/public/feedback.js" />


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