Qwen Image 3.0 Pro API
由阿里巴巴通义千问提供支持的 Qwen Image 3.0 Pro 模型完整 API 参考。
模型变体
此 API 支持两种模型变体:
快速比较
支持的宽高比
两种模型均支持 7 种宽高比:
16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3
Qwen Image 3.0 Pro(文本生成图片)
端点
POST /api/v1/image/task
身份验证
Authorization: Bearer YOUR_API_KEY
请求参数
必需参数
注意: 宽高比必须是以下值之一:16:9、9:16、1:1、4:3、3:4、3:2、2:3
可选参数
请求示例
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 professional product photo with studio lighting',
width: 16,
height: 9,
seed: 42
})
});
const { data } = await response.json();
const taskId = data.task_id;
const pollResponse = await fetch(
`https://api.flaq.ai/api/v1/image/${taskId}`,
{
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}
);
const result = await pollResponse.json();
console.log(result.data.task_result.images[0].url);
Qwen Image 3.0 Pro Edit(图片编辑)
端点
POST /api/v1/image/task
请求参数
必需参数
注意: 宽高比必须是以下值之一:16:9、9:16、1:1、4:3、3:4、3:2、2:3
可选参数
单图编辑示例
{
model_name: 'qwen-image-3.0-pro-edit',
prompt: 'Transform this image into a professional portrait with soft studio lighting',
width: 16,
height: 9,
image_url_list: ['https://example.com/image1.jpg']
}
多图合成示例
单个请求最多可合成 3 张图片:
{
model_name: 'qwen-image-3.0-pro-edit',
prompt: 'Combine these images into a cohesive landscape',
width: 16,
height: 9,
image_url_list: [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg',
'https://example.com/image3.jpg'
],
seed: 42
}
响应格式
初始响应
所有模型都会返回用于轮询的 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/{taskId} 以检查状态:
{
"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:生成失败
最佳实践
文本生成图片技巧
- 具体明确:在提示词中包含主体、风格、光照和构图细节
- 选择宽高比:根据使用场景选择比例(网页横幅使用 16:9,移动端使用 9:16,社交媒体使用 1:1)
- 使用种子复现结果:需要在多个请求中获得一致结果时,请设置固定的
seed 值
图片编辑技巧
- 清晰的指令:在提示词中明确说明要更改的内容
- 多图合成:最多提供 3 张图片,并描述其合成方式
- 图片质量:质量更高的输入图片通常会产生更好的编辑结果