Qwen Image 2.1 Turbo 画像生成
alibaba/qwen-image-2.1-turbo/text-to-image
テキストから1〜6枚の画像を生成します。プロンプト拡張と推論モードに対応。
サンプル
パラメータ
| 名前 | 型 | 既定 | 制約 | 説明 |
|---|---|---|---|---|
| prompt *プロンプト | textarea | — | ≤ 5000 chars | 生成したい画像を説明するテキストプロンプトです。中国語と英語に対応し、4500 トークン以内を推奨します。ネガティブプロンプトには対応していないため、含めたくない内容はプロンプト内に直接記述してください(例:「画像に文字を入れない」)。透過背景・ステッカー・切り抜きなどを指定すると、アルファチャンネル付きの PNG が自動で出力されます。 |
| n生成枚数 | number | 1 | 1 ~ 6 · step 1 | 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 トークン以内を推奨します。ネガティブプロンプトには対応していないため、含めたくない内容はプロンプト内に直接記述してください(例:「画像に文字を入れない」)。透過背景・ステッカー・切り抜きなどを指定すると、アルファチャンネル付きの PNG が自動で出力されます。; max 5000 characters |
n | integer | false | 1 | 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] |
料金
生成に成功した画像1枚につき $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 Text-to-Image は、テキストプロンプトから高品質な画像を生成できます。アスペクト比、解像度、品質を設定でき、クリエイティブ制作、SNS コンテンツ、マーケティング素材、制作ワークフローに適しています。すぐに使える 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 は、自然言語の指示と1枚以上の参照画像を使用して画像編集を可能にします。すぐに使える REST 推論 API、最高のパフォーマンス、コールドスタートなし、手頃な価格。
OpenAI GPT Image 2.5 Sunburst テキストから画像生成
複雑な構図や高精細な制作に適した画像生成モデルで、最大 4K 出力に対応します。
OpenAI GPT Image 2.5 Flare テキストから画像生成
自然言語プロンプトから高速かつ高品質な画像を生成し、最大 4K 出力に対応します。