ByteDance

bytedance/seedream-5-flash-layerize/image-to-image

图生图
预览
生成结果演示示例登录后试用

$0.027 / 张 · 约 37 张/$1

图片与图层

正在准备图片…

正在准备图片…

底图

z: 0

dark green ginkgo leaf

z: 1

Extract the complete dark green ginkgo leaf including its stem, preserve all original vein details, leaf shape, color, edges, position and appearance.

coral-orange sphere

z: 2

Extract the full solid coral-orange sphere, preserve its original smooth surface, color, edges, position and lighting appearance.

ivory origami crane

z: 3

Extract the complete intact ivory origami crane as a single unified object, preserve all original folded paper edges, color, position and appearance, do not split its individual folded parts.

价格

单价 $0.027 / 张

按实际生成张数结算。

约 37 张/$1

每次请求会先临时冻结 $0.027,按实际用量扣费,通常在一分钟内完成:多余部分退回,超出部分从余额扣除,余额可能因此变为负数;余额为负时新请求暂停,充值后先抵扣欠款。

生成失败不收费。

API 接入

用这个模型 ID 提交生成请求。

POST/v1/model-tasks
bytedance/seedream-5-flash-layerize/image-to-image
请求体
{
  "model": "bytedance/seedream-5-flash-layerize/image-to-image",
  "input": {
    "prompt": "Separate the three main foreground objects into individual transparent layers: the complete ivory origami crane, the coral-orange sphere, and the dark green ginkgo leaf. Keep the crane as one object rather than splitting its folded paper parts. Return a clean base image containing only the pale aqua studio background and tabletop, plus one layer for each of the three objects. Preserve the original positions, colors, edges and appearance. Return layer names and descriptions in English.",
    "image_url": "https://pub-a7287c8d5de944d984e22a5bd3ab9bbe.r2.dev/uploads/capability-demo-0072d694a35c704c7b203372df1fd60d.png",
    "image_size": "auto_1K"
  }
}

输入 Schema

参数类型是否必填默认值
image_urlstring必填—
image_sizestring可选auto
promptstring可选

返回结果

接口会返回生成结果,或返回可轮询的异步任务;具体响应方式与结果字段见下方示例和 Schema。

异步任务
提交响应
HTTP 202
/v1/model-tasksapplication/json
{
  "id": "task_example",
  "model": "bytedance/seedream-5-flash-layerize/image-to-image",
  "status": "queued"
}
状态响应
HTTP 200
/v1/model-tasks/{id}application/json
{
  "id": "task_example",
  "model": "bytedance/seedream-5-flash-layerize/image-to-image",
  "status": "completed",
  "output": {
    "layers": [
      {
        "image": {
          "url": "https://api.musespan.com/v1/model-tasks/task_example/artifacts/0"
        }
      }
    ],
    "images": [
      {
        "url": "https://api.musespan.com/v1/model-tasks/task_example/artifacts/1"
      }
    ]
  }
}
文件下载
HTTP 200
/v1/model-tasks/{id}/artifacts/{index}生成的图片(如 image/png)

任务完成后,output 里的文件地址就指向此接口,序号从 0 开始。下载时要带上同一个 API Key(Authorization 请求头)。

错误响应
HTTP 400
/v1/model-tasksapplication/json
{
  "error": {
    "code": "invalid_input",
    "message": "The input does not match this model's input schema. Check the model's API documentation.",
    "type": "invalid_request_error"
  }
}

调用示例

异步任务提交后返回任务 ID,轮询至 status 为 completed 后,按返回结果获取生成内容。API Key 在控制台获取。

# Use a new directory for each new generation. Rerunning here continues this task.
set -eu
test -s model-task-id.txt || python3 -c "import uuid; print(uuid.uuid4())" > model-task-id.txt
REQUEST_ID=$(cat model-task-id.txt)
# Idempotent: resending the same bytes with the same ID never charges twice.
curl --fail-with-body --retry 3 --retry-connrefused --request POST 'https://api.musespan.com/v1/model-tasks' \
  --header "Authorization: Bearer $MUSESPAN_API_KEY" \
  --header "X-Request-Id: $REQUEST_ID" \
  --header "Content-Type: application/json" \
  --data '{"model":"bytedance/seedream-5-flash-layerize/image-to-image","input":{"prompt":"Separate the three main foreground objects into individual transparent layers: the complete ivory origami crane, the coral-orange sphere, and the dark green ginkgo leaf. Keep the crane as one object rather than splitting its folded paper parts. Return a clean base image containing only the pale aqua studio background and tabletop, plus one layer for each of the three objects. Preserve the original positions, colors, edges and appearance. Return layer names and descriptions in English.","image_url":"https://pub-a7287c8d5de944d984e22a5bd3ab9bbe.r2.dev/uploads/capability-demo-0072d694a35c704c7b203372df1fd60d.png","image_size":"auto_1K"}}'
# Poll every 5 seconds for up to 25 minutes until status is completed or failed.
# Still queued (with queue_position) 5 minutes after submission: failed with queue_timeout, not charged.
# No result 15 minutes after acceptance (or no confirmation 15 minutes after submission): failed with generation_timeout, not charged.
# Any failure is final: generate again in a new directory (a new X-Request-Id).
# A 404 means the POST did not arrive: rerun this script to resend it with the same ID.
curl --fail-with-body 'https://api.musespan.com/v1/model-tasks/'"$REQUEST_ID"'' --header "Authorization: Bearer $MUSESPAN_API_KEY"

必要 Cookie 用于登录、安全防护和保存本次选择。统计、广告及第三方客服的非必要 Cookie 和脚本仅在接受后启用。接受或拒绝均不影响必要的登录功能。

可随时从页脚更改选择。若已加载非必要服务,撤回会刷新此页面,并清理这些服务可访问的第一方 Cookie;这不会删除供应商已持有的历史数据。

隐私政策