ListenHubDocs
API 参考图片生成

Seedream

Seedream 5.0 Pro 的限制,以及由提示词中的像素坐标和色号驱动的精准区域编辑。

Seedream 5.0 Pro 是 ListenHub 上字节跳动的图片模型,也是整个模型目录中唯一支持精准编辑的模型 ——改的是已有图片中指定的区域,而不是重新生成整张图。它走共用的图片接口。接口本身、请求 schema、 异步流程和错误码请看 图片生成总览,本页只讲 Seedream 的专属 部分。

模型

模型显示名称适用场景
seedream-5-0-proSeedream 5.0 Pro编辑给定图片中的指定区域

使用 provider: "bytedance"。

限制

限制项值
图片尺寸1K、2K——4K 返回 400
宽高比全部 14 种,含四种极端比例
默认宽高比1:1(来自请求 schema)
参考图最多 10 张
quality忽略

Seedream 校验的是尺寸,不是比例:schema 接受的每一种比例都在范围内——包括另外只有 Nano Banana Flash 才允许的那四种极端比例。输出像素由尺寸预算和你传的 aspectRatio 共同算出——而 aspectRatio 在 schema 层默认为 1:1,所以请显式设置它以匹配你的源图。唯一的硬限制是尺寸: 4K 会被直接拒绝,带 code: 29003,而不是被静默降级为 2K。

精准编辑

没有单独的编辑接口,也没有蒙版或区域参数。编辑用的就是同一个生成接口:源图放在 referenceImages 里,“改什么、怎么改”写进 prompt。模型直接从提示词文本中读取绝对像素坐标(原点在图片左上角)和 行业通用色号。

{
  "provider": "bytedance",
  "model": "seedream-5-0-pro",
  "prompt": "Treating the top-left corner as the coordinate origin, change the content inside top-left:(376,363) bottom-right:(701,638) to green, and leave everything else unchanged",
  "referenceImages": [
    {
      "fileData": {
        "fileUri": "https://assets.listenhub.app/your-source-image.png",
        "mimeType": "image/png"
      }
    }
  ],
  "imageConfig": { "imageSize": "2K", "aspectRatio": "1:1" }
}

服务端会原样透传提示词,不解析坐标。如果你的产品提供可视化编辑手势(框选、套索、箭头),请在自己 的前端把它们转成坐标字符串——或者把标注直接画进参考图——再写进 prompt。aspectRatio 要与源图的真实比例保持一致;不一致可能让模型重建整张图,而不是只编辑 一个区域。

计费

Seedream 按图片尺寸固定积分计价(pricing.mode 为 fixed),并且从不设置 requiresSubscription。它有一个免费额度资源(seedream-5-0-pro),可用于 1K 和 2K ——也就是它支持的全部尺寸。精确数字请调用 POST /v1/images/generation/estimate-credits 获取。

示例

curl -X POST "https://api.marswave.ai/openapi/v1/images/generation/async" \
  -H "Authorization: Bearer $LISTENHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "bytedance",
    "model": "seedream-5-0-pro",
    "prompt": "Treating the top-left corner as the coordinate origin, repaint the jacket inside top-left:(120,240) bottom-right:(520,880) in #1F4D3A, keep the face, hair and background unchanged",
    "referenceImages": [
      { "fileData": { "fileUri": "https://example.com/portrait.png", "mimeType": "image/png" } }
    ],
    "imageConfig": { "imageSize": "2K", "aspectRatio": "3:4" }
  }'

完整参数列表和带参考图的请求结构,见 图片生成总览。

本页内容