Modellere dön
Canlı APIQwen Image
Canlı APIQwen ImageQwen Image 2.1
qwen-image-2.1Text-to-image and reference editing at 1K or 2K, with up to 10 images, local masks, and optional transparent backgrounds.
Model genel bakışı
- Uç nokta
- /api/v1/images/generations
- Kredi maliyeti
- 4 credits at 1K, 8 at 2K
- Tipik gecikme
- Async
- Girdi ve çıktı
- Text, up to 10 images → PNG, WebP, or JPEG
Yetenekler
- 1K and 2K output
- Up to 10 reference images
- Local mask edits
- Transparent PNG or WebP
İstek parametreleri
| Parametre | Tür | Gereklilik | Açıklama |
|---|---|---|---|
| model | string | Zorunlu | Model identifier. Varsayılan: qwen-image-2.1 |
| prompt | string | Zorunlu | Generation or edit prompt, up to 5000 characters. |
| image_urls | string[] | İsteğe bağlı | One to ten public image URLs. Supplying images switches the request to image editing. |
| aspect_ratio | string | İsteğe bağlı | 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. Varsayılan: 3:2 for text-to-image, auto for edits |
| resolution | 1K | 2K | İsteğe bağlı | Output resolution tier. 2K costs more credits than 1K. Varsayılan: 1K |
| background | opaque | transparent | İsteğe bağlı | Transparent output cannot be JPEG, and cannot be combined with a mask. Varsayılan: opaque |
| output_format | png | webp | jpeg | İsteğe bağlı | Generated file format. Varsayılan: png |
| enhance_prompt | boolean | İsteğe bağlı | Expand the prompt before generation. prompt_extend is accepted as an alias. Varsayılan: true |
| seed | integer | İsteğe bağlı | Integer from 0 to 2147483647. Varsayılan: 0 |
| mask_url | string | İsteğe bağlı | Public mask URL for a local edit. Requires exactly one reference image and an opaque background. |
İstek örneği
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"
}'Oluşturma uç noktası eşzamansızdır. Aynı Bearer anahtarıyla GET /api/v1/tasks/ adresini sorgulayın.