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。
- 使用高质量输入:清晰的源图像通常可以获得控制更准确的编辑结果。