概述
Qwen Image 3.0 Pro 图片生成接口,在标准版基础上进一步增强,内容更丰实,适合报纸、分镜、菜单、试卷等密集图文排版场景。支持文生图(text-to-image)和图生图编辑(image-to-image),支持 1K/2K 两档分辨率与多种宽高比,并额外支持提示词扩展模式(promptExtendMode)。图生图最多支持 3 张参考图片。
Base URL: https://api.apiverse.ai
认证方式
所有接口均需要在请求头中携带 Token 进行认证:
Authorization: Bearer {YOUR_AUTH_TOKEN}快速开始
cURL 示例
创建文生图任务(密集排版)
curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/qwen-image-3-pro" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "一份西餐厅菜单,分前菜/主菜/甜品三栏,每栏 5 道菜带价格,衬线字体,米色底",
"aspectRatio": "3:4",
"resolution": "2K",
"promptExtendMode": "agent"
}'创建图生图编辑任务
curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/qwen-image-3-pro" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "把画面里的招牌文字改成「营业中」,其余保持不变",
"imageUrls": ["https://example.com/shop.jpg"],
"aspectRatio": "1:1",
"resolution": "2K"
}'查询任务状态
curl -X GET "https://api.apiverse.ai/api/v2/open/aigc/task_abc123" \
-H "Authorization: Bearer your_auth_token_here"接口列表
1. 创建 Qwen Image 3.0 Pro 图片生成任务
POST /api/v2/open/aigc/qwen-image-3-pro
创建一个 Qwen Image 3.0 Pro 图片生成任务。
Content-Type: application/json
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| prompt | string | 是 | 图片描述提示词 |
| imageUrls | string[] | 否 | 参考图片 URL(图生图,最多 3 张,JPEG/PNG/WebP,单张最大 10MB) |
| aspectRatio | string | 否 | 宽高比:1:1(默认) / 16:9 / 9:16 / 4:3 / 3:4 / 3:2 / 2:3 |
| resolution | string | 否 | 输出分辨率:1K(默认) / 2K |
| promptExtendMode | string | 否 | 提示词扩展模式:direct / agent。agent 改写更激进,仅文生图(不带 imageUrls)时可用 |
| taskNickname | string | 否 | 任务昵称,便于识别 |
| callbackUrl | string | 否 | 任务完成后的回调通知 URL |
说明:
- 提供 imageUrls 时自动进入图生图编辑模式,模型将基于参考图片进行生成
- 图生图最多支持 3 张参考图片,每张最大 10MB,支持 JPEG/PNG/WebP 格式
- resolution 仅支持1K/2K(大写),传入其他值将返回参数错误
- promptExtendMode 仅支持direct/agent;其中agent仅在文生图(不带 imageUrls)时可用,图生图场景传agent将返回参数错误
- 计费提示:Pro 版 2K 档价格为 1K 档的两倍
请求示例
基础文生图:
{
"prompt": "一份报纸头版排版,含大标题、两栏正文与一张配图说明"
}密集排版 + 提示词扩展:
{
"prompt": "一份数学试卷,含选择题 5 道、填空题 5 道、解答题 2 道,标注分值,衬线字体",
"aspectRatio": "3:4",
"resolution": "2K",
"promptExtendMode": "agent"
}图生图编辑(单张参考图):
{
"prompt": "把海报里的日期改为「10 月 1 日」,其余保持不变",
"imageUrls": ["https://example.com/poster.jpg"],
"aspectRatio": "3:4",
"resolution": "2K"
}图生图编辑(多张参考图):
{
"prompt": "参考这些分镜草图,生成一页连贯的四格漫画",
"imageUrls": [
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg",
"https://example.com/ref3.jpg"
],
"aspectRatio": "3:4",
"resolution": "2K"
}带回调地址:
{
"prompt": "一张活动海报,主标题「年度盛典」,含时间地点信息,现代简约风",
"aspectRatio": "9:16",
"resolution": "2K",
"callbackUrl": "https://your-server.com/callback"
}响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码,0 表示成功 |
| msg | string | 状态信息 |
| data.taskId | string | 任务 ID,用于查询任务状态 |
| data.status | string | 任务状态,创建时固定为 processing |
| data.createdAt | string | 创建时间 |
响应示例
成功
{
"code": 0,
"msg": "success",
"data": {
"taskId": "task_20260810150000_abc12345",
"status": "processing",
"createdAt": "2026-08-10 15:00:00"
}
}2. 查询任务状态
GET /api/v2/open/aigc/{taskId}
查询单个任务的执行状态。
响应示例
成功
{
"code": 0,
"msg": "success",
"data": {
"taskId": "task_20260810150000_abc12345",
"status": "success",
"result": [
"https://fc-gw-sh.oss-accelerate.aliyuncs.com/images/2026/08/10/output_001.png"
],
"createdAt": "2026-08-10 15:00:00",
"updatedAt": "2026-08-10 15:00:28"
}
}3. 批量查询任务状态
POST /api/v2/open/aigc/batch
批量查询多个任务的执行状态(最多 100 个)。
回调通知
当任务完成(成功或失败)时,如果创建任务时提供了 callbackUrl,系统会向该 URL 发送 POST 请求。
回调请求
Headers
Content-Type: application/json
X-Funcloud-Event: task.completed
X-Funcloud-Signature: {签名}Body
{
"event": "task.completed",
"taskId": "task_20260810150000_abc12345",
"status": "success",
"result": ["https://fc-gw-sh.oss-accelerate.aliyuncs.com/images/output_001.png"],
"errorMsg": "",
"timestamp": "2026-08-10T15:00:28+08:00",
"signature": "a1b2c3d4e5f6..."
}错误码
| code | 说明 |
|---|---|
| 0 | 成功 |
| 10002 | 参数缺失或格式错误(如 resolution 非 1K/2K、promptExtendMode 取值非法、图生图误用 agent) |
| 10005 | API Key 无效或缺失 |
| 30003 | 任务不存在 |
| 90003 | 服务器内部错误 |
最佳实践
1. 何时选择 Pro
- 排版密集、字多的场景(菜单、报纸、分镜、试卷等)优先用 Pro;常规出图用标准版 Qwen Image 3.0 更划算。
2. 轮询策略
建议的轮询间隔:
- 前 30 秒:每 3 秒查询一次
- 30 秒后:每 5 秒查询一次
- 超时约 3 分钟(2K 更慢)
3. 使用回调
生产环境建议使用回调通知而非轮询。
4. 处理时间参考
- 文生图(1K):通常 8 ~ 25 秒
- 文生图(2K):通常 15 ~ 40 秒
- 图生图编辑:通常 15 ~ 40 秒
5. 分辨率与计费
| 分辨率 | 适用场景 | 计费 |
|---|---|---|
| 1K | 快速预览、社交媒体 | 基准价 |
| 2K | 高质量展示、印刷、密集排版 | 为 1K 的两倍 |
6. 任务失败退款
任务失败将全额退还本次冻结额度,参考图不额外计费。