跳转到主要内容
POST
/
v1
/
tasks
Qwen Image 系列
curl --request POST \
  --url https://www.qingbo.dev/v1/tasks \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "action": "<string>",
  "prompt": "<string>",
  "n": 123,
  "aspect_ratio": "<string>",
  "resolution": "<string>",
  "image_urls": [
    "<string>"
  ],
  "callback_url": "<string>",
  "callback_events": [
    "<string>"
  ]
}
'
import requests

url = "https://www.qingbo.dev/v1/tasks"

payload = {
    "model": "<string>",
    "action": "<string>",
    "prompt": "<string>",
    "n": 123,
    "aspect_ratio": "<string>",
    "resolution": "<string>",
    "image_urls": ["<string>"],
    "callback_url": "<string>",
    "callback_events": ["<string>"]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    model: '<string>',
    action: '<string>',
    prompt: '<string>',
    n: 123,
    aspect_ratio: '<string>',
    resolution: '<string>',
    image_urls: ['<string>'],
    callback_url: '<string>',
    callback_events: ['<string>']
  })
};

fetch('https://www.qingbo.dev/v1/tasks', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://www.qingbo.dev/v1/tasks"

	payload := strings.NewReader("{\n  \"model\": \"<string>\",\n  \"action\": \"<string>\",\n  \"prompt\": \"<string>\",\n  \"n\": 123,\n  \"aspect_ratio\": \"<string>\",\n  \"resolution\": \"<string>\",\n  \"image_urls\": [\n    \"<string>\"\n  ],\n  \"callback_url\": \"<string>\",\n  \"callback_events\": [\n    \"<string>\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://www.qingbo.dev/v1/tasks")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"<string>\",\n  \"action\": \"<string>\",\n  \"prompt\": \"<string>\",\n  \"n\": 123,\n  \"aspect_ratio\": \"<string>\",\n  \"resolution\": \"<string>\",\n  \"image_urls\": [\n    \"<string>\"\n  ],\n  \"callback_url\": \"<string>\",\n  \"callback_events\": [\n    \"<string>\"\n  ]\n}")
  .asString();
{
  "task_id": "task-wave1775285160b950328499",
  "model": "qwen-image-2.0-pro",
  "action": "generate",
  "status": "queued",
  "created_at": 1775285160040,
  "progress": 0
}
阿里通义千问图像系列,两档定位:
  • 2.0 Pro — 旗舰最高保真档,原生 2K、强细节、准确构图、专业级文字渲染,适合信息图、海报、营销资产
  • 2.0 — 标准版,集成生成和编辑能力,支持超长提示词,2K 高质量输出,适合需要清晰文字和专业设计美感的场景
按张计费,统一接口同时支持文生图 / 图生图 / 多图参考。

定价

模型单价(每张)
qwen-image-2.0-pro$0.05625
qwen-image-2.0$0.0225

模式速查

模式触发字段支持版本
文生图prompt全部
图生图+ image_urls(单张)+ action: "image2image"全部
多图参考融合+ image_urls(多张)+ action: "reference"全部

调用示例

curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-2.0-pro",
    "prompt": "国风海报:水墨山水背景,正中竖排标题“千问”二字,金箔点缀,专业排版",
    "resolution": "2K",
    "aspect_ratio": "3:4"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-2.0",
    "action": "image2image",
    "prompt": "把这张照片转成赛博朋克风格,保留人物面部特征",
    "image_urls": ["https://cdn.example.com/portrait.jpg"],
    "resolution": "2K",
    "aspect_ratio": "9:16"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-2.0-pro",
    "action": "reference",
    "prompt": "把第一张图的角色穿上第二张图的服装,放进第三张图的场景中",
    "image_urls": [
      "https://cdn.example.com/character.jpg",
      "https://cdn.example.com/outfit.jpg",
      "https://cdn.example.com/scene.jpg"
    ],
    "resolution": "2K",
    "aspect_ratio": "16:9"
  }'
{
  "task_id": "task-wave1775285160b950328499",
  "model": "qwen-image-2.0-pro",
  "action": "generate",
  "status": "queued",
  "created_at": 1775285160040,
  "progress": 0
}
提交后用 GET /v1/tasks/{task_id} 轮询状态,详见 任务系统

可用模型

模型 ID说明
qwen-image-2.0-pro旗舰版,原生 2K,强细节、准确构图、专业级文字渲染
qwen-image-2.0标准版,生成 + 编辑一体,超长提示词,2K 高质量输出

通用参数

model
string
必填
可用模型 列表中选一个
action
string
默认值:"generate"
操作类型,可选值:
  • generate — 文生图(默认)
  • image2image — 图生图(需配合 image_urls)
  • reference — 多图参考融合(需配合多张 image_urls)
prompt
string
必填
图像描述文本,支持中英文。Qwen Image 系列对超长提示词与中文文字渲染友好
n
integer
默认值:"1"
生成数量,单次返回多张。取值范围 1–6
aspect_ratio
string
默认值:"1:1"
画面宽高比,可选值:
  • 1:1 — 正方形
  • 4:3 / 3:4 — 横/竖版标准
  • 16:9 / 9:16 — 横/竖版宽屏
  • 3:2 / 2:3 — 横/竖版相机比
resolution
string
默认值:"1K"
输出分辨率,可选值:
  • 1K — 普通分辨率(默认)
  • 2K — 高分辨率
image_urls
string[]
参考 / 输入图片 URL 数组。只支持公网可访问的 URL,不接受 base64
  • image2image 模式:1 张
  • reference 模式:多张
callback_url
string
Webhook 回调地址,任务终态时调用。详见 回调机制
callback_events
string[]
订阅的回调事件类型,默认订阅终态(succeeded / failed)

模型特定参数

支持 action:generate / image2image / referenceresolution:1K / 2Kaspect_ratio:1:1 / 4:3 / 3:4 / 16:9 / 9:16 / 3:2 / 2:3核心特性:旗舰最高保真档,原生 2K、强细节、准确构图、专业级文字渲染,适合信息图、海报、营销资产
negative_prompt
string
负面提示词,描述不希望出现的内容。最长 500 字符

资源限制

项目限制
prompt 长度≤ 800 字符
negative_prompt 长度≤ 500 字符
参考图来源必须公网可访问 URL,不支持 base64 直传
单张参考图大小≤ 30MB,支持 JPG / PNG / WEBP
输出分辨率1K / 2K
输出文件链接 24 小时有效

相关文档