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

# Qwen Image Edit

> Qwen Image Edit：按照文字要求编辑参考图。不要使用 multipart，也不要把请求包装进 `metadata`。

按照文字要求编辑参考图。不要使用 multipart，也不要把请求包装进 `metadata`。

`POST /v1/images/generations`

## 快速示例

运行前请设置 `MIXROUTE_API_KEY`。 将 `https://example.com/reference.png` 替换为可公开访问的 HTTPS 图片地址。

```bash theme={null}
curl --request POST 'https://api.mixroute.ai/v1/images/generations' \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "qwen-image-edit",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "text": "Change the mug to blue."
          },
          {
            "image": "https://example.com/reference.png"
          }
        ]
      }
    ]
  },
  "parameters": {
    "size": "1024*1024",
    "n": 1
  }
}'
```

从 `output.choices[].message.content[].image` 获取图片。

## 参数和限制

| 字段 | 说明 |
| - | - |
| `model` | `qwen-image-edit`. 填写示例中的完整模型 ID。 |
| `input.messages[].content[]` | 使用一条 `user` 消息，包含一个文本块和 1–3 个单独的图片块。 |
| `parameters.size` | 使用 `宽度*高度`，例如 `1024*1024`。 |
| `parameters.n` | 每次请求只支持 `1`。 |

## API 参考

* [Qwen 图像编辑](https://mixroute.ai/docs/zh-Hans/api-reference/endpoint/qwen-image-edit.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.