Qwen Image 3.0 Pro API
由 Alibaba Qwen 提供支援的 Qwen Image 3.0 Standard 和 Pro 模型完整 API 參考。
模型版本
此 API 支援四個模型版本:
快速比較
支援的長寬比
所有四個模型均支援以下長寬比:
16:9、9:16、1:1、4:3、3:4、3:2、2:3
端點
POST /api/v1/image/task
身分驗證
Authorization: Bearer YOUR_API_KEY
文字生成圖像
Standard 模型使用 qwen-image-3.0,Pro 模型使用 qwen-image-3.0-pro。
請求參數
必填
長寬比必須是以下選項之一:16:9、9:16、1:1、4:3、3:4、3:2、2:3。
選填
Standard 請求範例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'qwen-image-3.0',
prompt: 'A professional product photo with soft studio lighting',
width: 16,
height: 9,
resolution: '1k',
seed: 42
})
});
const { data } = await response.json();
const taskId = data.task_id;
Pro 請求範例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'qwen-image-3.0-pro',
prompt: 'A detailed editorial product scene with precise typography and cinematic lighting',
width: 16,
height: 9,
resolution: '2k',
seed: 42
})
});
const { data } = await response.json();
const taskId = data.task_id;
圖像編輯
Standard Edit 模型使用 qwen-image-3.0-edit,Pro Edit 模型使用 qwen-image-3.0-pro-edit。
請求參數
必填
長寬比必須是以下選項之一:16:9、9:16、1:1、4:3、3:4、3:2、2:3。
選填
Standard Edit 請求範例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'qwen-image-3.0-edit',
prompt: 'Transform the input into a polished editorial portrait with soft studio lighting',
width: 16,
height: 9,
resolution: '1k',
image_url_list: ['https://example.com/image1.jpg'],
seed: 42
})
});
const { data } = await response.json();
const taskId = data.task_id;
Pro Edit 多圖請求範例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'qwen-image-3.0-pro-edit',
prompt: 'Combine the products from these references into one cohesive campaign image',
width: 16,
height: 9,
resolution: '2k',
image_url_list: [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg',
'https://example.com/image3.jpg'
],
seed: 42
})
});
const { data } = await response.json();
const taskId = data.task_id;
回應格式
初始回應
所有模型都會傳回用於輪詢的 task_id:
{
"code": 0,
"data": {
"task_id": "{task_id}",
"task_status": "submitted",
"response_url": "https://api.flaq.ai/api/v1/image/{task_id}"
},
"message": "success"
}
輪詢回應
輪詢 GET /api/v1/image/{task_id} 以檢查任務狀態:
{
"code": 0,
"data": {
"task_id": "{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"response_url": "https://api.flaq.ai/api/v1/image/{task_id}",
"task_result": {
"credit": 0.0997,
"images": [
{
"url": "https://example.com/generated-image.jpeg"
}
]
}
},
"message": "success"
}
狀態值
submitted:任務已接受
processing:正在生成
succeed:生成已成功完成
failed:生成失敗
最佳實踐
文字生成圖像技巧
- 具體描述:在提示詞中包含主體、風格、光線、構圖和文字要求。
- 選擇解析度:根據所需的輸出解析度選擇
1k 或 2k。
- 選擇長寬比:根據用途選擇比例,例如橫幅使用 16:9,直向內容使用 9:16。
- 使用隨機種子重現結果:需要可重複的生成設定時,請設定固定的
seed。
圖像編輯技巧
- 使用清楚指示:說明哪些內容應該變更,哪些內容應該保持一致。
- 有序提供多個輸入:提供 1–3 張圖像,並在提示詞中說明每張參考圖像的作用。
- 選擇輸出解析度:獨立於輸入圖像尺寸選擇
1k 或 2k。
- 使用高品質輸入:清晰的來源圖像通常可以產生控制更精準的編輯結果。