> ## 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-Hant/api-reference/endpoint/qwen-image-edit.md)


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