Référence API de Qwen Image 2.1
Modèle ouvert avec sortie 2K et fonds transparents
Une seule clé API PopNow suffit pour appeler Qwen Image 2.1 depuis votre code. Vous trouverez ici les identifiants de modèle à envoyer, chaque champ d’entrée accepté, le coût d’une requête en crédits et une requête à coller telle quelle dans un terminal.
Les descriptions des paramètres proviennent du schéma d’entrée du modèle et ne sont disponibles qu’en anglais.
En bref
- Éditeur
- Alibaba
- Résultat
- Image
- À partir de
- 3.6 crédits par image ($0.036)
- Durée habituelle
- environ 44 s
- Identifiants de modèle
1 crédit = 0,01 $. À l’acceptation, une tâche réserve le montant maximal possible, puis facture la consommation réelle à la fin, arrondie au crédit supérieur ; le reste est libéré. Une tâche en échec n’est pas facturée. Pour connaître le montant exact avant de lancer, appelez POST /api/v1/jobs/quote.
Créer une image
alibaba/qwen-image-2.1/text-to-image
Prix
| Option | Crédits (par image) | Dollars US |
|---|---|---|
1k | 3.6 | $0.036 |
1.5k | 7.2 | $0.072 |
2k | 7.2 | $0.072 |
Paramètres
| Champ | Type | Valeur par défaut | Valeurs admises | Rôle |
|---|---|---|---|---|
promptObligatoire | string | — | jusqu’à 5 000 caractères | Describe the subject, composition, lighting, and any wording to render. |
aspect_ratioFacultatif | string | 1:1 | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21, 2:1, 1:2, 3:1, 1:3, 5:4, … (+1) | Output aspect ratio. |
resolutionFacultatif | string | 1k | 1k, 1.5k, 2k | Output resolution tier. |
enable_prompt_expansionFacultatif | boolean | true | — | Rewrite the prompt into a fuller scene description before generating. On by default; turn it off to have the prompt followed word for word. |
backgroundFacultatif | string | opaque | opaque, transparent | opaque keeps a normal background; transparent returns the subject alone on a real alpha channel (needs output_format png or webp). |
output_formatFacultatif | string | jpeg | jpeg, png, webp | Container of the returned image. |
seedFacultatif | integer | — | de 0 à 2147483647 | Random seed for controlled comparisons. |
Exemple de requête
Cette requête fonctionne telle quelle ; les champs omis gardent leur valeur par défaut. Placez d’abord votre clé dans POPNOW_API_KEY.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "alibaba/qwen-image-2.1/text-to-image",
"input": {
"prompt": "A cozy reading nook beside a rain-streaked window, warm lamp light, a sleeping orange cat on a knitted blanket, soft film grain",
"resolution": "1k"
}
}'La réponse contient tout de suite un taskId. Récupérez le résultat avec GET /api/v1/jobs/recordInfo, ou ajoutez callBackUrl pour être prévenu.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"Modifier une image
alibaba/qwen-image-2.1/edit
Prix
| Option | Crédits (par image) | Dollars US |
|---|---|---|
1k | 5.4 | $0.054 |
2k | 7.2 | $0.072 |
1.5k | 10.8 | $0.108 |
Paramètres
| Champ | Type | Valeur par défaut | Valeurs admises | Rôle |
|---|---|---|---|---|
promptObligatoire | string | — | jusqu’à 5 000 caractères | Describe the subject, composition, lighting, and any wording to render. |
image_urlsObligatoire | array<string (uri)> | — | jusqu’à 10 éléments | One to ten reference images. Each one you add raises the quote. |
mask_urlFacultatif | string (uri) | — | — | Optional black-and-white mask for local editing: white is the area to repaint, black is kept. Use it with exactly one reference image. |
aspect_ratioFacultatif | string | 1:1 | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21, 2:1, 1:2, 3:1, 1:3, 5:4, … (+1) | Output aspect ratio. |
resolutionFacultatif | string | 1k | 1k, 1.5k, 2k | Output resolution tier. |
enable_prompt_expansionFacultatif | boolean | true | — | Rewrite the prompt into a fuller scene description before generating. On by default; turn it off to have the prompt followed word for word. |
backgroundFacultatif | string | opaque | opaque, transparent | opaque keeps a normal background; transparent returns the subject alone on a real alpha channel (needs output_format png or webp). |
output_formatFacultatif | string | jpeg | jpeg, png, webp | Container of the returned image. |
seedFacultatif | integer | — | de 0 à 2147483647 | Random seed for controlled comparisons. |
Exemple de requête
Cette requête fonctionne telle quelle ; les champs omis gardent leur valeur par défaut. Placez d’abord votre clé dans POPNOW_API_KEY.
L’exemple utilise des fichiers d’exemple PopNow dans image_urls. Remplacez-les par vos propres liens HTTPS publics, fichiers envoyés ou ressources enregistrées.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask?wait=60" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "alibaba/qwen-image-2.1/edit",
"input": {
"prompt": "Change the orange jacket to deep forest green and add soft golden-hour light; keep the face, pose and background unchanged",
"image_urls": [
"https://media.popnow.ai/influencer/examples/marco.webp"
],
"resolution": "1k"
}
}'La réponse contient tout de suite un taskId. Récupérez le résultat avec GET /api/v1/jobs/recordInfo, ou ajoutez callBackUrl pour être prévenu.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
