Zurück zu den Modellen
Live-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.

Modellübersicht
Endpunkt
/api/v1/images/generations
Credit-Kosten
4 credits at 1K, 8 at 2K
Typische Latenz
Async
Ein- und Ausgabe
Text, up to 10 images → PNG, WebP, or JPEG

Funktionen

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

Anfrageparameter

ParameterTypAnforderungBeschreibung
modelstringErforderlichModel identifier. Standard: qwen-image-2.1
promptstringErforderlichGeneration or edit prompt, up to 5000 characters.
image_urlsstring[]OptionalOne to ten public image URLs. Supplying images switches the request to image editing.
aspect_ratiostringOptionalText-to-image ratios are 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, and 9:16. Image editing also accepts auto. Standard: 3:2 for text-to-image, auto for edits
resolution1K | 2KOptionalOutput resolution tier. 2K costs more credits than 1K. Standard: 1K
backgroundopaque | transparentOptionalTransparent output cannot be JPEG, and cannot be combined with a mask. Standard: opaque
output_formatpng | webp | jpegOptionalGenerated file format. Standard: png
enhance_promptbooleanOptionalExpand the prompt before generation. prompt_extend is accepted as an alias. Standard: true
seedintegerOptionalInteger from 0 to 2147483647. Standard: 0
mask_urlstringOptionalPublic mask URL for a local edit. Requires exactly one reference image and an opaque background.

Anfragebeispiel

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"
}'

Der Generierungsendpunkt ist asynchron. Rufen Sie GET /api/v1/tasks/ mit demselben Bearer-Schlüssel ab.