| 分辨率 | 宽高比 | 分辨率(px) |
|---|---|---|
| 2K | 1:1 | 2048 × 2048 |
| 4:3 | 2304 × 1728 | |
| 3:2 | 2496 × 1664 | |
| 16:9 | 2560 × 1440 | |
| 21:9 | 3024 × 1296 | |
| 4K | 1:1 | 4096 × 4096 |
| 4:3 | 4694 × 3520 | |
| 3:2 | 4992 × 3328 | |
| 16:9 | 5404 × 3040 | |
| 21:9 | 6198 × 2656 |
| 字段名 | 类型 | 说明 |
|---|---|---|
| model | string | 本次请求使用的模型 ID(模型名称-版本)。 |
| created | integer | 本次请求创建时的 Unix 时间戳(秒)。 |
| data | list | 输出图片的信息,包括图片下载的 URL 或 Base64。 - 当指定返回格式为 url 时,字段为 url- 当指定返回格式为 b64_json 时,字段为 b64_json注意:为确保信息安全,url 链接将在生成后 24 小时内失效,请务必及时保存图片。 |
| usage | object | 图片生成相关信息。 - usage.generated_images(integer):模型生成的图片张数。 |
| error | object | 错误信息(可选)。 - error.code(string):错误码- error.message(string):错误提示信息 |
response_format 为 url 时,data 数组的每个元素包含字段:url:图片下载地址response_format 为 b64_json 时,data 数组的每个元素包含字段:b64_json:图片的 Base64 编码字符串usage.generated_images:模型生成的图片张数(integer)error.code:错误码(string)error.message:错误提示信息(string)curl --location --request POST 'https://api.302.ai/doubao/images/generations' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "doubao-seedream-4-5-251128",
"prompt": "将图1的服装换为图2的服装",
"image": [
"https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimage_1.png",
"https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_5_imagesToimage_2.png"
],
"sequential_image_generation": "disabled",
"size": "2K",
"watermark": false
}'{
"model": "doubao-seedream-4-0-250828",
"created": 1757321139,
"data": [
{
"url": "https://...",
"size": "3104x1312"
}
],
"usage": {
"generated_images": 1,
"output_tokens": xxx,
"total_tokens": xxx
}
}