openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/v1/images/edits:
post:
summary: 图片编辑/edits
deprecated: false
description: >-
根据一个或多个原始图片和提示创建编辑或扩展的图片。此端点支持 dall-e-2 和 gpt-image-1 模型。
官方文档:https://platform.openai.com/docs/api-reference/images/createEdit
注意事项:
还在世的艺术家名称(如「宫崎骏」、「新海诚」等)会触发 moderation_blocked
报错,导致生成失败。你可以通过「吉卜力」、「明亮的现代日式动漫风格」等非敏感词来规避。衣着暴露或含有暗示的图片同理。
总的来说,「风格」比「艺术家」安全,像是「皮克斯」也是支持的。
更稳妥的做法是采用已故艺术家或对应的风格,如「梵高」、「蒙娜丽莎」等。
对于单次请求生成 2-10
张图片的情况,如果系统检测到请求涉嫌违反平台政策,该请求中的违规部分将不会被生成。这可能导致实际生成图片数量少于用户请求数量,然而多图的情况下,不会抛出
moderation_blocked。 因此,请在创作中主动规避潜在的知识产权(IP)或版权问题,以减少生成被系统拦截的风险,确保创作顺利完成。
✍️ 关键提示:
避免直接使用已知的受版权保护角色、品牌标志、名人肖像等
可以采用「风格借鉴」「创意改编」「泛指描述」等方式表达
若需引用特定元素,请提前确认该元素是否处于公有领域
实用提示
支持任何语言,中文绘制也很稳定,但我们也不建议绘制大量的文本
size 参数不支持显示传入 size=“auto”,默认即 auto
画幅比例可以在 prompt 中指定,支持 2:3、3:2、1:1,也可以在 size 参数中设置。
支持控制敏感度的 moderation 参数,但这个参数设为 low 也可能被拒,比如说维纳斯过于暴露
edits 端口不支持 moderation 参数
文本描述和参考图搭配,融图效果更准确
上传的图片可以做压缩预处理,提升速度
支持透明背景,免抠图。——只需要在 Prompt 中补充要求
tags:
- 模型接口/Openai
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:
multipart/form-data:
schema:
type: object
properties:
model:
description: gpt-image-1或sora_image
example: gpt-image-1
type: string
image:
format: binary
type: string
description: >-
需要编辑的图片。
For the GPT image models (gpt-image-1, gpt-image-1-mini, and
gpt-image-1.5), each image should be a png, webp, or jpg
file less than 50MB. You can provide up to 16 images.
example: ''
prompt:
description: >-
提示词
. The maximum length is 1000 characters for dall-e-2, and
32000 characters for the GPT image models.
example: 添加一只小狗
type: string
quality:
description: |-
生成图片质量
high, medium and low
example:
- ''
type: array
background:
description: |-
允许设置生成图像背景的透明度。
transparent、opaque、auto
example: ''
type: string
'n':
type: integer
description: |-
生成图片数量。
The number of images to generate. Must be between 1 and 10
example: 0
size:
description: >-
图片尺寸
Must be one of 1024x1024, 1536x1024 (landscape), 1024x1536
(portrait), or auto
example: ''
type: string
required:
- model
- image
- prompt
examples: {}
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
created:
type: string
data:
type: array
items:
type: object
properties:
url:
type: string
x-apifox-orders:
- url
required:
- url
x-apifox-orders:
- created
- data
required:
- created
- data
example:
created: 1589478378
data:
- url: https://...
- url: https://...
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 模型接口/Openai
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/5503894/apis/api-319292012-run
components:
schemas: {}
securitySchemes: {}
servers:
- url: '{{base_url}}'
description: 测试环境
- url: https://newapi.eronmind.com
description: 正式环境
security: []