PopNowDocs API
Contenu principal

Référence API de Qwen Image 2.1 Turbo

Rendus rapides en 8 étapes, jusqu’à six par prompt

Une seule clé API PopNow suffit pour appeler Qwen Image 2.1 Turbo 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
2.16 crédits par image ($0.0216)
Durée habituelle
environ 28 s

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-turbo/text-to-image

Prix

OptionCrédits (par image)Dollars US
Par défaut2.16$0.0216

Paramètres

ChampTypeValeur par défautValeurs admisesRôle
promptObligatoirestring—jusqu’à 5 000 caractèresDescribe the subject, composition, lighting, and any wording to render. There is no negative prompt: write what to leave out directly in the prompt.
aspect_ratioFacultatifstring1:11: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.
resolutionFacultatifstring2k1k, 1.5k, 2kOutput resolution tier. Every tier costs the same.
num_outputsFacultatifinteger1de 1 à 6How many images to generate in one request (1 to 6). Billed per image returned.
enable_prompt_expansionFacultatifbooleanfalse—Let the service rewrite and expand the prompt before generating. Off by default so the prompt is followed word for word.
enable_thinkingFacultatifbooleantrue—Spend extra reasoning on the rewrite for better images, at the cost of a longer wait. Only works while prompt expansion is on.
prompt_optimization_modeFacultatifstringdirectdirect, agentHow prompt expansion rewrites the brief: direct is a single pass that suits most prompts; agent is a multi-step rewrite with finer detail.
seedFacultatifinteger—de 0 à 2147483647Random 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.

POST /api/v1/jobs/createTask?wait=60
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-turbo/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",
    "num_outputs": 1
  }
}'

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.

GET /api/v1/jobs/recordInfo
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-turbo/edit

Prix

OptionCrédits (par image)Dollars US
Par défaut2.16$0.0216

Paramètres

ChampTypeValeur par défautValeurs admisesRôle
promptObligatoirestring—jusqu’à 5 000 caractèresDescribe the subject, composition, lighting, and any wording to render. There is no negative prompt: write what to leave out directly in the prompt.
image_urlsObligatoirearray<string (uri)>—jusqu’à 10 élémentsOne to ten source images, in the order you refer to them in the prompt (Image 1, Image 2 and so on).
aspect_ratioFacultatifstring—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. Omit it to let the model choose a size from the source images.
resolutionFacultatifstring2k1k, 1.5k, 2kOutput resolution tier. Every tier costs the same.
num_outputsFacultatifinteger1de 1 à 6How many images to generate in one request (1 to 6). Billed per image returned.
enable_prompt_expansionFacultatifbooleanfalse—Let the service rewrite and expand the prompt before generating. Off by default so the prompt is followed word for word.
enable_thinkingFacultatifbooleantrue—Spend extra reasoning on the rewrite for better images, at the cost of a longer wait. Only works while prompt expansion is on.
seedFacultatifinteger—de 0 à 2147483647Random 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.

POST /api/v1/jobs/createTask?wait=60
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-turbo/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"
    ],
    "num_outputs": 1
  }
}'

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.

GET /api/v1/jobs/recordInfo
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Pour aller plus loin

Sur cette page