Skip to content
EN

图像编辑(qwen-image-edit)

方法: POST路径: /v1/images/edits

请求参数

Header 参数

text
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}

Body 参数 multipart/form-data

text
image
file
支持多图
必需
示例:
E:\\Desktop\\gpt\\icon_samll2.png
prompt
string
必需
示例:
带上眼镜
model
string
必需
示例:
qwen-image-edit
size
string
可选
示例:
1024x1024
seed
string
可选
guidance_scale
string
可选
n
string
可选
enable_safety_checker
string
可选
output_format
string
可选
negative_prompt
string
可选

请求示例代码

Shell

bash
curl --location --request POST '/v1/images/edits' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--form 'image=@"E:\\\\Desktop\\\\gpt\\\\icon_samll2.png"' \
--form 'prompt="带上眼镜"' \
--form 'model="qwen-image-edit"' \
--form 'size="1024x1024"' \
--form 'seed=""' \
--form 'guidance_scale=""' \
--form 'n=""' \
--form 'enable_safety_checker=""' \
--form 'output_format=""' \
--form 'negative_prompt=""'

返回响应

🟢 200 成功

内容类型: application/json

响应结构

text
object

示例

json
{
    "created": 1713833628,
    "data": [
        {
            "url": "..."
        }
    ],
    "usage": {
        "total_tokens": 100,
        "input_tokens": 50,
        "output_tokens": 50,
        "input_tokens_details": {
            "text_tokens": 10,
            "image_tokens": 40
        }
    }
}