跳转到主要内容
通义千问-图像编辑模型支持多图输入和多图输出,可精确修改图内文字、增删或移动物体、改变主体动作、迁移图片风格及增强画面细节。

模型参数

  • 模型ID:qwen-image-edit/qwen-image-edit-plus
  • 模型价格:你可以在模型广场查看最新价格信息
  • 调用入口:https://geekai.co/api/v1/images/generations
  • 模型参数:参考画图 API 手册
  • API认证:获取 API KEY
不支持画图 API 中的以下参数:
  • strength
  • aspect_ratio
  • quality
  • style_preset
  • response_format
  • output_format
  • mask
  • background
附:Qwen-Image-Edit 官方 API 文档
通义千问-图像编辑可以通过 size 字段实现输出图像的分辨率,格式为宽x高字符串,例如”1024x2048”,宽和高的取值范围均为[512, 2048]像素,但此参数只在仅qwen-image-edit-plus系列模型支持, 可以通过n指定输出图像数量,默认值为1。qwen-image-edit-plus系列模型支持输出1-6张图片,qwen-image-edit模型仅支持输出1张图片。同样 image字段也支持输入base64编码的图片数据,符合data:;base64,即可。

图像编辑

curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "qwen-image-edit",
    "prompt": "生成一张符合深度图的图像,遵循以下描述:一辆红色的破旧的自行车停在一条泥泞的小路上,背景是茂密的原始森林",
    "image": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/fpakfo/image36.webp",
    "negative_prompt ": "低质量",
    "watermark": false
}'
响应是一个 JSON 对象,包含生成图片的 URL:
{
    "model": "qwen-image-edit",
    "created": 1767593301,
    "task_id": "5e22aad1-72e6-4206-8b7a-286a6d4a4dd9",
    "task_status": "succeed",
    "data": [
        {
            "url": "https://static.geekai.co/image/2026/01/05/9322e44329ac13b1604332bbb8b1baa4.png"
        }
    ],
    "usage": {
        "billed_units": 1
    }
}