分辨率等级 | 宽高比 | 宽度 (px) | 高度 (px) |
---|---|---|---|
1K | 1:1 | 1024 | 1024 |
4:3 | 1152 | 864 | |
3:4 | 864 | 1152 | |
16:9 | 1280 | 720 | |
9:16 | 720 | 1280 | |
3:2 | 1248 | 832 | |
2:3 | 832 | 1248 | |
21:9 | 1512 | 648 | |
2K | 1:1 | 2048 | 2048 |
4:3 | 2304 | 1728 | |
3:4 | 1728 | 2304 | |
16:9 | 2560 | 1440 | |
9:16 | 1440 | 2560 | |
3:2 | 2496 | 1664 | |
2:3 | 1664 | 2496 | |
21:9 | 3024 | 1296 | |
4K | 1:1 | 4096 | 4096 |
4:3 | 4736 | 3552 | |
3:4 | 3552 | 4736 | |
16:9 | 5472 | 2072 | |
9:16 | 2072 | 5472 | |
3:2 | 5024 | 3360 | |
2:3 | 3360 | 5024 | |
21:9 | 6272 | 2688 |
{
"model": "doubao-seedream-4-0-250828",
"prompt": "生成3张女孩和奶牛玩偶在游乐园开心地坐过山车的图片,涵盖早晨、中午、晚上",
"image": [
"https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimages_1.png",
"https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimages_2.png"
],
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 3
},
"response_format": "url",
"size": "2K",
"stream": false,
"watermark": false
}
curl --location --request POST 'https://api.302.ai/doubao/images/generations' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "doubao-seedream-4-0-250828",
"prompt": "生成3张女孩和奶牛玩偶在游乐园开心地坐过山车的图片,涵盖早晨、中午、晚上",
"image": [
"https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimages_1.png",
"https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imagesToimages_2.png"
],
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 3
},
"response_format": "url",
"size": "2K",
"stream": false,
"watermark": false
}'
字段名 | 类型 | 说明 |
---|---|---|
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){
"model": "doubao-seedream-4-0-250828",
"created": 1757321139,
"data": [
{
"url": "https://...",
"size": "3104x1312"
}
],
"usage": {
"generated_images": 1,
"output_tokens": xxx,
"total_tokens": xxx
}
}