Qwen Image 2.1 Turbo API
Qwen Image 2.1 Turbo 是 Qwen-Image-2.1 系列的蒸餾加速版本,透過知識蒸餾將去噪壓縮至 8 步取樣,同時維持 2K 級影像生成能力。
Qwen Image 2.1 Turbo 是阿里巴巴 Qwen 團隊基於 Qwen-Image-2.1 系列推出的蒸餾加速檢查點。它沿用相同的 7B 視覺生成架構,原生精度為 BF16,檔案大小約 14.2GB。透過知識蒸餾,它把去噪過程壓縮到 8 步取樣排程,在維持 2K 級影像生成的同時大幅提升速度,且幾乎沒有明顯的畫質損失。
在能力上,它支援文字生成影像,也支援以自然語言指令進行影像編輯,每次編輯請求最多可附加 4 張參考圖片,並可輸出 RGBA 格式以產生透明背景影像。它使用專屬的 8 步取樣排程與 CFG 1.0,建議搭配 euler 取樣方法;權重已發佈於 Hugging Face 與 ModelScope,可透過 Diffusers 的 QwenImage21Pipeline 載入。
這個模型特別適合需要高頻率、快速迭代的影像生成場景,例如產品視覺設計(海報、概念藝術、廣告素材)、電子商務產品圖與模特兒換裝,以及講求快速產出的內容創作流程。它在臉部細節還原上更強,產品文字與材質在新場景中的一致性也更好。使用時需注意:在 4-bit 及以下量化時輸出會明顯偏離原始結果;必須使用專屬的 8 步取樣排程,標準預設排程會產生不同影像;建議選用更高品質的量化文字編碼器,因為過度量化的編碼器會降低輸出品質;此外,此模型採用 Qwen Research 授權,商業使用受到限制。
更新時間:
模型 ID
qwen-image-2.1-turbo- 輸入
- text / image
- 輸出
- image
核心要點
- 8 步取樣,大幅加速
- 維持 2K 級影像生成
- 支援自然語言影像編輯
- 最多 4 張參考圖片
- 可輸出 RGBA 透明背景
供應商
比較不同供應商的呼叫價格,點擊供應商可查看完整費用和適用條件。
| 可用率 | |||
|---|---|---|---|
| $0 | $0.0184 |
歷史統計不等於即時健康檢查,缺少資料不代表服務中斷。
基準測試
- 60.28
Qwen-Image-Bench
Unsloth 估計的 base Qwen-Image-2.1 分數,單位為分
分數來自模型廠商公布的資料,未經獨立驗證。
快速开始
提交圖片任務、輪詢狀態,再儲存圖片。以下範例使用 curl 和 Python 3(僅標準函式庫,無須安裝依賴)。
POST https://openapi.felo.ai/api/v1/images/generations
1填入 API key
從 Felo API Platform 帳戶建立 key,並設定為環境變數。
export FELO_API_KEY="YOUR_API_KEY"2發出第一次請求
選用參數的值依模型而異,範例不預設這些值;加入前請在 Playground 確認。請求欄位與 model、prompt 同層,不包在 input 中。
curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-o created.json \
-d '{
"prompt": "A studio product photo of a ceramic coffee cup on warm linen, soft morning light",
"model": "qwen-image-2.1-turbo"
}'3輪詢任務
提交後取得 task_id;queued、running 時每 3 秒查詢一次,succeeded、failed 或 interrupted 時停止。範例最多等待 30 分鐘。保留 created.json 可繼續查詢同一任務,避免重複提交。
python3 - <<'PY'
import json, os, time
from pathlib import Path
from urllib.parse import quote
from urllib.request import Request, urlopen
task = json.loads(Path("created.json").read_text())
task_id = task["task_id"]
url = "https://openapi.felo.ai/api/v1/images/generations/" + quote(task_id, safe="")
headers = {"Authorization": "Bearer " + os.environ["FELO_API_KEY"]}
deadline = time.monotonic() + 1800
while task["status"] in ("queued", "running"):
if time.monotonic() >= deadline:
raise TimeoutError(f"Keep task_id={task_id} to resume polling")
time.sleep(3)
with urlopen(Request(url, headers=headers), timeout=60) as response:
task = json.load(response)
if task.get("task_id") != task_id or task.get("kind") != "image":
raise ValueError("Unexpected task response")
print(task["status"])
if task["status"] != "succeeded":
raise RuntimeError(task.get("error") or task["status"])
if not task.get("outputs"):
raise ValueError("Task succeeded without image outputs")
Path("task.json").write_text(json.dumps(task))
print("Saved task.json")
PY4下載輸出
成功後從 task.json 讀取 outputs 並儲存。結果相容 HTTPS 位址、URL 物件和 b64_json。簽名位址請及時下載;下載圖片時無須攜帶 API Key。
python3 - <<'PY'
import base64, json
from pathlib import Path
from urllib.request import urlopen
task = json.loads(Path("task.json").read_text())
if task.get("status") != "succeeded" or not task.get("outputs"):
raise ValueError("No completed image outputs")
extensions = {"image/png": ".png", "image/jpeg": ".jpg", "image/webp": ".webp", "image/gif": ".gif", "image/avif": ".avif"}
for index, output in enumerate(task["outputs"], 1):
item = output if isinstance(output, dict) else {}
url = output if isinstance(output, str) else item.get("url") or item.get("unsigned_url")
mime = item.get("media_type") or "image/png"
if url and url.startswith("https://"):
with urlopen(url, timeout=60) as response:
data = response.read()
mime = response.headers.get_content_type()
elif url and url.startswith("data:image/") and ";base64," in url:
header, encoded = url.split(",", 1)
mime = header[5:].split(";", 1)[0]
data = base64.b64decode(encoded, validate=True)
elif item.get("b64_json"):
data = base64.b64decode(item["b64_json"], validate=True)
else:
raise ValueError("Unrecognized image output")
path = Path(f"image-{index}" + extensions.get(mime, ".bin"))
path.write_bytes(data)
print(path)
PYinput_references
編輯圖片時,將範例位址替換為你的 HTTPS 圖片位址或 base64 圖片 data URL。提交一次後,沿用相同的輪詢與儲存步驟。
curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-o created.json \
-d '{
"prompt": "Keep the product and framing. Replace the background with a sunlit marble countertop.",
"model": "qwen-image-2.1-turbo",
"input_references": [
{
"type": "image_url",
"image_url": {
"url": "https://example.com/product.png"
}
}
]
}'支援的參數
- n
- seed
- resolution
- aspect_ratio
- input_references
想查看完整文件?
API 文件 →常見問題
什麼是 Qwen Image 2.1 Turbo?
Qwen Image 2.1 Turbo 是阿里巴巴 Qwen 團隊基於 Qwen-Image-2.1 系列推出的蒸餾加速檢查點。它沿用相同的 7B 視覺生成架構,原生精度為 BF16,檔案大小約 14.2GB。透過知識蒸餾,它把去噪過程壓縮到 8 步取樣排程,在維持 2K 級影像生成的同時大幅提升速度,且幾乎沒有明顯的畫質損失。 在能力上,它支援文字生成影像,也支援以自然語言指令進行影像編輯,每次編輯請求最多可附加 4 張參考圖片,並可輸出 RGBA 格式以產生透明背景影像。它使用專屬的 8 步取樣排程與 CFG 1.0,建議搭配 euler 取樣方法;權重已發佈於 Hugging Face 與 ModelScope,可透過 Diffusers 的 QwenImage21Pipeline 載入。 這個模型特別適合需要高頻率、快速迭代的影像生成場景,例如產品視覺設計(海報、概念藝術、廣告素材)、電子商務產品圖與模特兒換裝,以及講求快速產出的內容創作流程。它在臉部細節還原上更強,產品文字與材質在新場景中的一致性也更好。使用時需注意:在 4-bit 及以下量化時輸出會明顯偏離原始結果;必須使用專屬的 8 步取樣排程,標準預設排程會產生不同影像;建議選用更高品質的量化文字編碼器,因為過度量化的編碼器會降低輸出品質;此外,此模型採用 Qwen Research 授權,商業使用受到限制。
如何計算呼叫費用?
費用取決於你使用的供應商、對應價格和實際用量。長文字輸入等情況可能適用不同價格,詳見計費明細。
這個模型支援哪些輸入與輸出?
它支援文字生成影像,也支援以自然語言指令進行影像編輯,每次編輯最多可附加 4 張參考圖片。輸出可為 RGBA 格式,用於產生透明背景影像。
它適合哪些任務?
適合高頻率的本地影像生成工作流程、產品視覺設計(如海報、概念藝術、廣告素材)、電子商務產品圖與模特兒換裝,以及需要快速迭代的內容創作。
取樣時有什麼特別要求?
它使用專屬的 8 步取樣排程與 CFG 1.0,並建議搭配 euler 取樣方法。若改用標準預設排程,會產生不同的影像。
它與 Qwen-Image-2.1 系列其他版本有何差別?
Qwen-Image-2.1 是品質基準,Turbo 是蒸餾加速版本,Pro 則提供更完整的 API 服務。三者形成標準、Turbo、Pro 的組合。
使用時有哪些限制?
在 4-bit 及以下量化時輸出會明顯偏離原始結果,且過度量化的文字編碼器會降低輸出品質。此外,此模型採用 Qwen Research 授權,商業使用受到限制。