doubao-seededit-3-0-i2i-250628

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": "您需要调用的模型的 ID。"
      },
      "prompt": {
        "type": "string",
        "description": "文本描述,用于编辑图像的提示词。"
      },
      "image": {
        "type": "string",
        "description": "需要编辑的图像,输入图片的 Base64 编码或可访问的 URL。\n图片URL:请确保图片URL可被访问。\nBase64编码:请遵循此格式data:image/<图片格式>;base64,<Base64编码>。注意 <图片格式> 需小写,如 data:image/png;base64,<base64_image>。\n说明\n传入图片需要满足以下条件:\n图片格式:jpeg、png。\n宽高比(宽/高):在范围 (1/3, 3) 。\n宽高长度(px) > 14。\n大小:不超过 10MB。"
      },
      "response_format": {
        "type": "string",
        "description": "指定生成图像的返回格式。支持以下两种取值:\nurl:以可下载的 jpeg 图片链接形式返回。\nb64_json:以 Base64 编码字符串的 JSON 格式返回图像数据。\n默认值 url"
      },
      "size": {
        "type": "string",
        "description": "生成图像的宽高像素。当前仅支持 adaptive。\nadaptive。将您的输入图片尺寸与下表中的尺寸进行对比,选择最接近的,作为输出图片的尺寸。具体而言,会按顺序从可选比例中,选取与原图宽高比差值最小的第一个,作为生成图片的比例。"
      },
      "seed": {
        "type": "integer",
        "description": "随机数种子,用于控制模型生成内容的随机性。取值范围为 [-1, 2^31-1],即 [-1, 2147483647] 之间的整数。如果不提供,则算法自动生成一个随机数作为种子。如果希望生成内容保持一致,可以使用相同的 seed 参数值。\n默认值 -1"
      },
      "guidance_scale": {
        "type": "number",
        "description": "文本描述和输入图片对生成图像的影响程度。取值范围:[1, 10] 之间的浮点数。该值越大代表文本描述影响程度越大,且输入图片影响程度越小。\n默认值 5.5"
      },
      "watermark": {
        "type": "boolean",
        "description": "是否在生成的图片中添加水印。\nfalse:不添加水印。\ntrue:在图片右下角添加“AI生成”字样的水印标识。\n默认值 true"
      }
    },
    "required": [
      "model",
      "prompt",
      "image"
    ],
    "x-apifox-orders": [
      "model",
      "prompt",
      "image",
      "response_format",
      "size",
      "seed",
      "guidance_scale",
      "watermark"
    ]
  },
  "required": false,
  "mediaType": "",
  "examples": [
    {
      "value": "{\n  \"model\": \"doubao-seededit-3-0-i2i-250628\",\n  \"prompt\": \"改成爱心形状的泡泡\",\n  \"image\": \"https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream_i2i.jpeg\",\n  \"response_format\": \"url\",\n  \"size\": \"adaptive\",\n  \"seed\": 21,\n  \"guidance_scale\": 5.5,\n  \"watermark\": true\n}",
      "mediaType": "application/json",
      "description": ""
    }
  ],
  "oasExtensions": ""
}

响应

[
  {
    "id": 731432523,
    "name": "Create image",
    "code": 200,
    "contentType": "json",
    "jsonSchema": {
      "type": "object",
      "properties": {
        "created": {
          "type": "integer"
        },
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            },
            "required": [
              "url"
            ],
            "x-apifox-orders": [
              "url"
            ]
          }
        }
      },
      "required": [
        "created",
        "data"
      ],
      "x-apifox-orders": [
        "created",
        "data"
      ]
    },
    "itemSchema": {},
    "description": "",
    "mediaType": "",
    "headers": [],
    "oasExtensions": ""
  }
]

响应示例

[
  {
    "name": "成功示例",
    "responseId": 731432523,
    "data": "{\r\n    \"created\": 1753847978,\r\n    \"data\": [\r\n        {\r\n            \"url\": \"https://ime.lqjmauqqw.org/O8e0UlcHYzQyIiSwniXP6UgQt4v42c5G-ept86400.jpeg\"\r\n        }\r\n    ],\r\n    \"model\": \"doubao-seededit-3-0-i2i-250628\",\r\n    \"usage\": {\r\n        \"generated_images\": 1,\r\n        \"output_tokens\": 3772,\r\n        \"total_tokens\": 3772\r\n    }\r\n}",
    "description": "",
    "oasKey": "",
    "oasExtensions": "",
    "id": 649966957
  }
]