跳到主要内容

图生图

OpenAPI Specification

openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/v1/images/generations:
post:
summary: 图生图
deprecated: false
description: 给定提示和/或输入图像,模型将生成新图像。
tags:
- 模型接口/豆包
parameters:
- name: Accept
in: header
description: ''
required: true
example: application/json
schema:
type: string
default: application/json
- name: Authorization
in: header
description: ''
required: true
example: sk-
schema:
type: string
default: sk-
- name: Content-Type
in: header
description: ''
required: true
example: application/json
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
model:
type: string
description: 本次请求使用模型的 Model ID。
prompt:
type: string
description: 用于生成图像的提示词,支持中英文。
size:
type: string
description: |-
指定生成图像的尺寸信息,支持以下两种方式,不可混用。
方式1 |指定生成图像的分辨率,可选值:1K、2K、4K
方式2 |指定生成图像的宽高像素值:默认值:2048x2048
面积取值范围:[1024x1024, 4096x4096]
宽高比取值范围:[1/16, 16]
watermark:
type: string
description: |-
是否在生成的图片中添加水印。默认值 true
false:不添加水印。
true:在图片右下角添加“AI生成”字样的水印标识。
image:
type: string
description: >-
输入的图片信息,支持 URL 或 Base64 编码。doubao-seedream-4.0 支持单图或多图输入。

图片URL:请确保图片URL可被访问。

Base64编码:请遵循此格式data:image/<图片格式>;base64,<Base64编码>。注意 <图片格式>
需小写,如 data:image/png;base64,<base64_image>
x-apifox-orders:
- model
- prompt
- image
- size
- watermark
required:
- model
- prompt
example:
model: doubao-seedream-4-5-251128
size: 2K
'n': 1
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
watermark: false
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties: {}
x-apifox-orders: []
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 模型接口/豆包
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/5503894/apis/api-395382398-run
components:
schemas: {}
securitySchemes: {}
servers:
- url: '{{base_url}}'
description: 测试环境
- url: https://newapi.eronmind.com
description: 正式环境
security: []