对接火山引擎的图像生成服务,支持流式 SSE、图生图和多图融合。

支持的模型

基础生成

curl -X POST https://ai.win10030.com/image/v1/generations \
  -H 'Authorization: Bearer sk-xxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "doubao-seedream-5-0-260128",
    "prompt": "一只在草地上奔跑的金毛犬",
    "size": "2k"
  }'

Base64 输出

curl -X POST https://ai.win10030.com/image/v1/generations \
  -H 'Authorization: Bearer sk-xxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "doubao-seedream-5-0-260128",
    "prompt": "a cat",
    "size": "1024x1024",
    "response_format": "b64_json"
  }'

图生图

curl -X POST https://ai.win10030.com/image/v1/generations \
  -H 'Authorization: Bearer sk-xxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "doubao-seedream-5-0-260128",
    "prompt": "把这张照片变成卡通风格",
    "image": "https://example.com/portrait.jpg",
    "size": "1024x1024",
    "upstream_options": { "watermark": false, "guidance_scale": 7.5 }
  }'

多图融合

curl -X POST https://ai.win10030.com/image/v1/generations \
  -H 'Authorization: Bearer sk-xxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "doubao-seedream-5-0-260128",
    "prompt": "把人物放进场景",
    "image": ["https://example.com/person.jpg", "https://example.com/scene.jpg"],
    "size": "1024x1024"
  }'

image 也支持对象数组 [{ file_id, image_url }]。

流式

curl -N -X POST https://ai.win10030.com/image/v1/generations \
  -H 'Authorization: Bearer sk-xxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "doubao-seedream-5-0-260128",
    "prompt": "金毛犬在草地上奔跑",
    "size": "2k",
    "stream": true
  }'

常用 upstream_options

参数说明
watermark水印开关,默认 true
guidance_scale提示词引导强度,1-20
sequential_image_generation组图模式
output_format输出格式,如 png、webp

相关

概览

输入与输出计价

全部 Seedream 使用统一计价结构,具体单价由平台为各模型配置。输入图片首张免费,第 2 张起按输入单价计费;每张成功输出图片按实际宽×高分别选择 ≤261 万或 >261 万像素档位。普通生成和图层拆分分别配置价格。费用汇总并应用折扣后统一取整,output_tokens 不参与按张费用计算。

GET /image/v1/models/:code/endpoints 的 pricing.images.seedream 返回完整对客价格、折后价和法币换算。image 单价是普通生成低像素档参考价。历史消费明细保留调用时的分项价格。

图层拆分

在 upstream_options 设置 layer_decomposition: true,并传入一张 image。此场景可省略 prompt。返回图片保留 size,图层顺序、名称、说明和边界框位于每张图的 provider_metadata。

{
  "model": "your-model-code",
  "image": "https://example.com/image.png",
  "size": "auto",
  "upstream_options": { "layer_decomposition": true }
}

是否支持图层拆分、流式或组图由上游模型决定;5.0 Pro / Flash 当前不支持流式或组图。