doubao-seedream-4-5-251128 多参考图生组图

POST /v1/images/generations

MethodPOST
Path/v1/images/generations
Typehttp
Status1
Module2102810
Folder62716892

说明

给定提示和/或输入图像,模型将生成新图像。

相关指南:图像生成

根据提示创建图像。

概览

MethodPOST
Path/v1/images/generations
Typehttp
Status1
Module2102810
Folder62716892

参数

{
  "query": [],
  "path": [],
  "cookie": [],
  "header": [
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "GTujCrB2It",
      "enable": true,
      "name": "Authorization",
      "sampleValue": "Bearer {{YOUR_API_KEY}}"
    }
  ]
}

请求体

{
  "type": "application/json",
  "parameters": [],
  "jsonSchema": {
    "type": "object",
    "properties": {
      "model": {
        "type": "string",
        "description": "本次请求使用模型的 Model ID。"
      },
      "prompt": {
        "type": "string",
        "description": "用于生成图像的提示词,支持中英文。"
      },
      "size": {
        "type": "string",
        "description": "指定生成图像的尺寸信息,支持以下两种方式,不可混用。\n方式1 |指定生成图像的分辨率,可选值:2K、4K\n方式2 |指定生成图像的宽高像素值:默认值:2048x2048\n面积取值范围:[1024x1024, 4096x4096] \n宽高比取值范围:[1/16, 16]"
      },
      "sequential_image_generation": {
        "type": "string",
        "description": "控制是否关闭组图功能。默认值 disabled\n取值范围:\nauto:自动判断模式,模型会根据用户提供的提示词自主判断是否返回组图以及组图包含的图片数量。\ndisabled:关闭组图功能,模型只会生成一张图。"
      },
      "stream": {
        "type": "boolean",
        "description": "控制是否开启流式输出模式。默认值 false"
      },
      "response_format": {
        "type": "string",
        "description": "指定生成图像的返回格式。默认值 url\n生成的图片为 jpeg 格式,支持以下两种返回方式:\nurl:返回图片下载链接;链接在图片生成后24小时内有效,请及时下载图片。\nb64_json:以 Base64 编码字符串的 JSON 格式返回图像数据。"
      },
      "watermark": {
        "type": "boolean",
        "description": "是否在生成的图片中添加水印。默认值 true\nfalse:不添加水印。\ntrue:在图片右下角添加“AI生成”字样的水印标识。"
      }
    },
    "required": [
      "model",
      "prompt"
    ],
    "x-apifox-orders": [
      "model",
      "prompt",
      "size",
      "sequential_image_generation",
      "stream",
      "response_format",
      "watermark"
    ]
  },
  "required": false,
  "mediaType": "",
  "examples": [
    {
      "value": "{\n    \"model\": \"doubao-seedream-4-5-251128\",\n    \"prompt\": \"生成3张女孩和奶牛玩偶在游乐园开心地坐过山车的图片,涵盖早晨、中午、晚上\",\n    \"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\"],\n    \"sequential_image_generation\": \"auto\",\n    \"sequential_image_generation_options\": {\n        \"max_images\": 3\n    },\n    \"size\": \"2K\",\n    \"watermark\": false\n}",
      "mediaType": "application/json",
      "description": ""
    }
  ],
  "oasExtensions": ""
}

响应

[
  {
    "id": 765211305,
    "name": "成功",
    "code": 200,
    "contentType": "json",
    "jsonSchema": {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            }
          }
        },
        "created": {
          "type": "integer"
        },
        "usage": {
          "type": "object",
          "properties": {
            "prompt_tokens": {
              "type": "integer"
            },
            "completion_tokens": {
              "type": "integer"
            },
            "total_tokens": {
              "type": "integer"
            },
            "prompt_tokens_details": {
              "type": "object",
              "properties": {
                "cached_tokens_details": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "cached_tokens_details"
              ]
            },
            "completion_tokens_details": {
              "type": "object",
              "properties": {}
            },
            "output_tokens": {
              "type": "integer"
            }
          },
          "required": [
            "prompt_tokens",
            "completion_tokens",
            "total_tokens",
            "prompt_tokens_details",
            "completion_tokens_details",
            "output_tokens"
          ]
        }
      },
      "required": [
        "data",
        "created",
        "usage"
      ]
    },
    "itemSchema": {},
    "description": "",
    "mediaType": "",
    "headers": [],
    "oasExtensions": ""
  }
]

响应示例

[
  {
    "name": "成功示例",
    "responseId": 765211305,
    "data": "{\r\n    \"data\": [\r\n        {\r\n            \"url\": \"https://ark-content-generation-v2-cn-beijing.tos-cn-beijing.volces.com/doubao-seedream-4-0/0217574690542070fa6ef8c2347680bd87fd8d357bb16f1e5ca0f_0.jpeg?X-Tos-Algorithm=TOS4-HMAC-SHA256&X-Tos-Credential=AKLTYWJkZTExNjA1ZDUyNDc3YzhjNTM5OGIyNjBhNDcyOTQ%2F20250910%2Fcn-beijing%2Ftos%2Frequest&X-Tos-Date=20250910T015107Z&X-Tos-Expires=86400&X-Tos-Signature=fbc5369be594d6e21be983ed1ec32463b5f82cf0c18c4349e477c11e51e55fa0&X-Tos-SignedHeaders=host\"\r\n        }\r\n    ],\r\n    \"created\": 1757469067,\r\n    \"usage\": {\r\n        \"prompt_tokens\": 0,\r\n        \"completion_tokens\": 0,\r\n        \"total_tokens\": 15908,\r\n        \"prompt_tokens_details\": {\r\n            \"cached_tokens_details\": {}\r\n        },\r\n        \"completion_tokens_details\": {},\r\n        \"output_tokens\": 15908\r\n    }\r\n}",
    "description": "",
    "oasKey": "",
    "oasExtensions": "",
    "id": 676397205
  }
]