> ## Documentation Index
> Fetch the complete documentation index at: https://docs.geekai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# 千问图像编辑

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

### 模型参数

* 模型ID：`qwen-image-edit`/`qwen-image-edit-plus`
* 模型价格：你可以在[模型广场](https://geekai.co/models?platform=dashscope\&type=image)查看最新价格信息
* 调用入口：`https://geekai.co/api/v1/images/generations`
* 模型参数：参考[画图 API 手册](https://docs.geekai.co/cn/api/image/generations)
* API认证：[获取 API KEY](https://docs.geekai.co/cn/docs/quick_start)

<Note>
  不支持画图 API 中的以下参数：

  * `strength`
  * `aspect_ratio`
  * `quality`
  * `style_preset`
  * `response_format`
  * `output_format`
  * `mask`
  * `background`

  附：[Qwen-Image-Edit 官方 API 文档](https://help.aliyun.com/zh/model-studio/qwen-image-edit-guide?spm=5176.smartservice_service_robot_chat_new.0.0.1c8f3a98ftAoNh#ac07d69b4ag98)
</Note>

通义千问-图像编辑可以通过 `size` 字段实现输出图像的分辨率,格式为宽x高字符串，例如"1024x2048"，宽和高的取值范围均为\[512, 2048]像素,但此参数只在仅qwen-image-edit-plus系列模型支持，
可以通过`n`指定输出图像数量，默认值为1。qwen-image-edit-plus系列模型支持输出1-6张图片，qwen-image-edit模型仅支持输出1张图片。同样 `image`字段也支持输入base64编码的图片数据，符合data:{mime_type};base64,{base64_data}即可。

### 图像编辑

```bash theme={null}
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：

```json theme={null}
{
    "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
    }
}
```
