モデル一覧に戻る
稼働中 APIQwen Image

Qwen Image 2.1

qwen-image-2.1

Text-to-image and reference editing at 1K or 2K, with up to 10 images, local masks, and optional transparent backgrounds.

モデル概要
エンドポイント
/api/v1/images/generations
クレジットコスト
4 credits at 1K, 8 at 2K
標準的な処理時間
Async
入力と出力
Text, up to 10 images → PNG, WebP, or JPEG

機能

  • 1K and 2K output
  • Up to 10 reference images
  • Local mask edits
  • Transparent PNG or WebP

リクエストパラメータ

パラメータ型必須区分説明
modelstring必須Model identifier. デフォルト: qwen-image-2.1
promptstring必須Generation or edit prompt, up to 5000 characters.
image_urlsstring[]任意One to ten public image URLs. Supplying images switches the request to image editing.
aspect_ratiostring任意Text-to-image ratios are 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, and 9:16. Image editing also accepts auto. デフォルト: 3:2 for text-to-image, auto for edits
resolution1K | 2K任意Output resolution tier. 2K costs more credits than 1K. デフォルト: 1K
backgroundopaque | transparent任意Transparent output cannot be JPEG, and cannot be combined with a mask. デフォルト: opaque
output_formatpng | webp | jpeg任意Generated file format. デフォルト: png
enhance_promptboolean任意Expand the prompt before generation. prompt_extend is accepted as an alias. デフォルト: true
seedinteger任意Integer from 0 to 2147483647. デフォルト: 0
mask_urlstring任意Public mask URL for a local edit. Requires exactly one reference image and an opaque background.

リクエスト例

curl https://qwenapi.org/api/v1/images/generations \
  -H "Authorization: Bearer $QWEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen-image-2.1",
  "prompt": "Editorial poster for a night market, bold headline NIGHT MARKET, gold ink on charcoal paper, wide margins",
  "aspect_ratio": "3:2",
  "resolution": "1K",
  "output_format": "png"
}'

生成エンドポイントは非同期です。同じ Bearer キーで GET /api/v1/tasks/ をポーリングしてください。