Qwen Image 2.1 Turbo 文生图
alibaba/qwen-image-2.1-turbo/text-to-image
根据提示词生成 1~6 张图片,支持提示词扩展和思考模式。
示例
参数
| 名称 | 类型 | 默认 | 约束 | 说明 |
|---|---|---|---|---|
| prompt *提示词 | textarea | — | ≤ 5000 chars | 用于描述目标图片的文本提示词,支持中文和英文,建议不超过 4500 Token。本模型不支持反向提示词,不希望出现的内容请直接写在提示词中(如“画面中不要出现文字”)。描述透明背景、贴纸、抠图等需求时,模型会自动输出带透明通道的 PNG |
| n生成张数 | number | 1 | 1 ~ 6 · step 1 | 单次生成 1-6 张图片,按成功生成的张数计费 |
| size尺寸 | text | — | ≤ 16 chars | 格式为宽*高,总像素 512*512 至 2048*2048,宽高比 1:8 至 8:1。推荐:2048*2048(1:1)、2688*1536(16:9)、1536*2688(9:16)、2368*1728(4:3)、1728*2368(3:4)。留空时由模型根据提示词自动推荐分辨率。 |
| prompt_extend智能改写 | boolean | true | — | 自动扩写优化提示词,官方建议开启,对短提示词效果提升明显 |
| prompt_extend_mode改写方式 | select | direct | direct | agent | direct:直接增强,适用于大多数场景;agent:智能体增强,改写效果更精细 |
| enable_thinking思考模式 | boolean | true | — | 开启后增强推理以提升出图质量,但会增加生成耗时。仅在开启智能改写时生效 |
| seed随机种子 | number | — | 0 ~ 2147483647 · step 1 | 用于结果复现,取值 0-2147483647,留空表示随机 |
输出字段
| 字段 | 类型 | 说明 |
|---|---|---|
| images | array<string> |
API
通过统一 REST API 调用本模型;在 API Keys 页获取密钥。
cURL
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/alibaba/qwen-image-2.1-turbo/text-to-image" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "A cozy futuristic reading nook inside a glass-walled apartment overlooking a rainy cyberpunk city at dusk, warm ambient lighting, a woman sitting in a curved chair reading a book, shelves with plants and soft blankets, realistic textures, cinematic composition, highly detailed, polished typography on a subtle book cover only, no extra text in the image, no watermark",
"n": 1,
"size": "2048*2048",
"prompt_extend": true,
"prompt_extend_mode": "direct",
"enable_thinking": true,
"seed": 12345
}
}'
# 2) Poll until status is "completed", then read the output URLs
curl "https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID" \
-H "Authorization: Bearer YOUR_API_KEY"Python
import time, requests
API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1) Submit
resp = requests.post(
"https://www.namifusion.com/api/v1/marketplace/run/alibaba/qwen-image-2.1-turbo/text-to-image",
headers=HEADERS,
json={
"input": {
"prompt": "A cozy futuristic reading nook inside a glass-walled apartment overlooking a rainy cyberpunk city at dusk, warm ambient lighting, a woman sitting in a curved chair reading a book, shelves with plants and soft blankets, realistic textures, cinematic composition, highly detailed, polished typography on a subtle book cover only, no extra text in the image, no watermark",
"n": 1,
"size": "2048*2048",
"prompt_extend": True,
"prompt_extend_mode": "direct",
"enable_thinking": True,
"seed": 12345
}
},
)
resp.raise_for_status() # 401/402/429/5xx stop here instead of polling a bad task
task = resp.json()
# 2) Poll until a terminal state (completed / failed / cancelled).
# This model is allowed up to 1800s server-side.
deadline = time.time() + 1860
while task.get("status") not in ("completed", "failed", "cancelled"):
if time.time() > deadline:
raise TimeoutError(f"still {task.get('status')} — keep the task_uuid and poll later")
time.sleep(3)
poll = requests.get(f"https://www.namifusion.com/api/v1/marketplace/run/tasks/{task['task_uuid']}", headers=HEADERS)
poll.raise_for_status()
task = poll.json()
print(task["status"], task.get("output"))JavaScript
const API_KEY = "YOUR_API_KEY";
const HEADERS = { Authorization: `Bearer ${API_KEY}` };
// 1) Submit
const resp = await fetch("https://www.namifusion.com/api/v1/marketplace/run/alibaba/qwen-image-2.1-turbo/text-to-image", {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({
"input": {
"prompt": "A cozy futuristic reading nook inside a glass-walled apartment overlooking a rainy cyberpunk city at dusk, warm ambient lighting, a woman sitting in a curved chair reading a book, shelves with plants and soft blankets, realistic textures, cinematic composition, highly detailed, polished typography on a subtle book cover only, no extra text in the image, no watermark",
"n": 1,
"size": "2048*2048",
"prompt_extend": true,
"prompt_extend_mode": "direct",
"enable_thinking": true,
"seed": 12345
}
}),
});
if (!resp.ok) throw new Error(`submit failed: ${resp.status} ${await resp.text()}`);
let task = await resp.json();
// 2) Poll until a terminal state (completed / failed / cancelled).
// This model is allowed up to 1800s server-side.
const deadline = Date.now() + 1860 * 1000;
while (!["completed", "failed", "cancelled"].includes(task.status)) {
if (Date.now() > deadline) throw new Error(`still ${task.status} — keep the task_uuid and poll later`);
await new Promise((r) => setTimeout(r, 3000));
const poll = await fetch(`https://www.namifusion.com/api/v1/marketplace/run/tasks/${task.task_uuid}`, { headers: HEADERS });
if (!poll.ok) throw new Error(`poll failed: ${poll.status}`);
task = await poll.json();
}
console.log(task.status, task.output);文档
Qwen Image 2.1 Turbo 文生图
alibaba/qwen-image-2.1-turbo/text-to-image
根据提示词生成 1~6 张图片,支持提示词扩展和思考模式。
参数
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | true | — | 用于描述目标图片的文本提示词,支持中文和英文,建议不超过 4500 Token。本模型不支持反向提示词,不希望出现的内容请直接写在提示词中(如“画面中不要出现文字”)。描述透明背景、贴纸、抠图等需求时,模型会自动输出带透明通道的 PNG; max 5000 characters |
n | integer | false | 1 | 单次生成 1-6 张图片,按成功生成的张数计费 [1, 6] |
size | string | false | — | 格式为宽高,总像素 512512 至 20482048,宽高比 1:8 至 8:1。推荐:20482048(1:1)、26881536(16:9)、15362688(9:16)、23681728(4:3)、17282368(3:4)。留空时由模型根据提示词自动推荐分辨率。; max 16 characters |
prompt_extend | boolean | false | true | 自动扩写优化提示词,官方建议开启,对短提示词效果提升明显 |
prompt_extend_mode | string | false | "direct" | direct:直接增强,适用于大多数场景;agent:智能体增强,改写效果更精细 direct, agent |
enable_thinking | boolean | false | true | 开启后增强推理以提升出图质量,但会增加生成耗时。仅在开启智能改写时生效 |
seed | integer | false | — | 用于结果复现,取值 0-2147483647,留空表示随机 [0, 2.14748e+09] |
价格
每张成功生成的图片 $0.016(1.6 积分)。按请求 n 预扣,按实际成功输出张数结算。参考图片、输出尺寸、提示词扩展均不额外收费。默认 n=1。
size 使用宽*高格式,总像素为 512²~2048²,宽高比 1:8~8:1;省略时自动选择。省略 seed 使用随机种子。enable_thinking 仅在 prompt_extend=true 时生效。
采用 Alibaba International 国际部署标准美元标价。1 美元=100 积分,账户折扣另行计算。
API
curl -X POST https://www.namifusion.com/api/v1/marketplace/run/alibaba/qwen-image-2.1-turbo/text-to-image \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"input": {
"n": 1,
"seed": 12345,
"size": "2048*2048",
"prompt": "A cozy futuristic reading nook inside a glass-walled apartment overlooking a rainy cyberpunk city at dusk, warm ambient lighting, a woman sitting in a curved chair reading a book, shelves with plants and soft blankets, realistic textures, cinematic composition, highly detailed, polished typography on a subtle book cover only, no extra text in the image, no watermark",
"prompt_extend": true,
"enable_thinking": true,
"prompt_extend_mode": "direct"
}
}'
curl 'https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID' \
-H "Authorization: Bearer $API_KEY"
使用 task_uuid 轮询至 completed 或 failed。成功时 output.images 为输出 URL 字符串数组。
相关模型
z-image-spicy/text-to-image
从文本提示生成高质量图片,支持 256 至 1536 像素自定义尺寸、智能提示词扩写和随机种子,适合创意设计与批量出图。
xAI Grok Imagine Image v2.0 文生图
xAI Grok Imagine Image V2.0 文生图可根据文本提示词生成高质量图片,并支持配置宽高比、分辨率和质量,适用于创意视觉、社交内容、营销素材和生产工作流。提供开箱即用的 REST 推理 API,性能出色,无冷启动,价格实惠。
Qwen Image 3.0 Pro 文生图
Qwen Image 3.0 Pro 是一款专业级文生图模型,具备卓越画质和先进的提示词理解能力。最高支持 2k。提供开箱即用的 REST inference API,性能出色,无冷启动,价格实惠。
ai/prefect-pony-xl 动漫风格图片生成模型
Prefect Pony XL 可高质量生成动漫风格图片,适用于角色立绘和插画创作。提供开箱即用的 REST 推理 API,性能出色,无冷启动,价格实惠。
OpenAI GPT Image 2 文本生成图片
OpenAI 的 GPT Image 2 文本生成图片模型可根据自然语言提示词生成高质量图片。提供即用型 REST 推理 API,性能最佳,无冷启动,价格实惠。
OpenAI GPT Image 2 Edit 图像编辑
OpenAI 的 GPT Image 2 Edit 可通过自然语言指令结合一张或多张参考图片进行图像编辑。提供即用型 REST 推理 API,性能最佳,无冷启动,价格实惠。
OpenAI GPT Image 2.5 Sunburst 文本生成图片
面向复杂构图和高要求生产场景的高保真图片生成,最高支持 4K 输出。
OpenAI GPT Image 2.5 Flare 文本生成图片
根据自然语言提示词快速生成高质量图片,兼顾速度与效果,最高支持 4K 输出。