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

# Qwen Image 生成與編輯 API

> Qwen Image 整合指南 - Ace Data Cloud

`POST https://api.acedata.cloud/qwen-image/images` 透過同一介面完成文生圖和 1–3 張參考圖編輯，支援 `qwen-image-3.0` 與 `qwen-image-3.0-pro`。

## 選擇模型

| 模型 | 適合情境 | 官方標準價格 |
| - | - | - |
| `qwen-image-3.0` | 批量創作、快速迭代 | 輸出 \$0.030/張 |
| `qwen-image-3.0-pro` | 複雜排版、高精度成片 | 1K $0.040/張；2K $0.075/張 |

參考圖依實際輸入數量計費，官方標準價格 \$0.003/張。

## 同步生成

```bash theme={null}
curl -X POST 'https://api.acedata.cloud/qwen-image/images' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "qwen-image-3.0",
    "prompt": "A simple red circle centered on a clean white background.",
    "size": "1024*1024",
    "n": 1,
    "watermark": false
  }'
```

成功回應包含永久 CDN 圖片地址、實際 usage 和本次費用：

```json theme={null}
{
  "success": true,
  "task_id": "565a7f55-72c6-43ed-b274-268ff046e5b4",
  "trace_id": "bb923cec-1550-43b4-8df2-288ac0977b4b",
  "data": [
    {"image_url": "https://cdn.acedata.cloud/assets/examples/qwen-image/40d5c76b-2f84-4b04-9ea0-b706417ae622-bac6a9e9de22.png"}
  ],
  "usage": {
    "input_image_count": 0,
    "output_image_count": 1,
    "output_image_type": "qima_output_1k",
    "output_width": 1024,
    "output_height": 1024
  },
  "cost": {"amount": 0.322, "currency": "credit", "list_amount": 0.35}
}
```

## 參考圖編輯

增加 `image_urls`，支援 1–3 張公開可存取圖片：

```json theme={null}
{
  "model": "qwen-image-3.0-pro",
  "prompt": "保留主体，将背景改成暖色电影海报风格",
  "image_urls": [
    "https://cdn.acedata.cloud/assets/examples/qwen-image/40d5c76b-2f84-4b04-9ea0-b706417ae622-bac6a9e9de22.png"
  ],
  "size": "2048*2048",
  "n": 1,
  "watermark": false
}
```

`prompt_extend_mode=agent` 僅用於文生圖。`n` 範圍為 1–6；寬高比須在 1:8 至 8:1 之間。

## 非同步任務

設定 `async: true` 後介面立即回傳 `task_id`。使用 `/qwen-image/tasks` 查詢終態，或傳入 `callback_url` 接收完成通知。生成僅結算一次，任務查詢不重複計費。


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