PopNowDocs API
Contenu principal

Référence API de Wan 2.7

Réfléchit à la composition, puis dessine jusqu’à quatre images

Une seule clé API PopNow suffit pour appeler Wan 2.7 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
4.5 crédits par image ($0.045)
Durée habituelle
environ 26 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/wan-2.7/text-to-image

Prix

OptionCrédits (par image)Dollars US
Par défaut4.5$0.045

Paramètres

ChampTypeValeur par défautValeurs admisesRôle
promptObligatoirestring—jusqu’à 5 000 caractèresDescribe the image to generate: subject, composition, style, and lighting.
aspect_ratioFacultatifstring1:11:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3Aspect ratio of the generated image.
enable_thinkingFacultatifbooleantrue—Run the deep-thinking pass before generating. Turning it off generates faster.
num_outputsFacultatifinteger1de 1 à 4How many images to generate in one run.
resolutionFacultatifstring1k1k, 2kOutput resolution tier.
color_paletteFacultatifarray<object>—jusqu’à 10 élémentsCustom colour theme: 3 to 10 colours, each with an optional share of the image in percent. Leave the shares empty to split them evenly.
seedFacultatifinteger—de 0 à 2147483647Random seed. Omit to let the model pick one.

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/wan-2.7/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/wan-2.7/edit

Prix

OptionCrédits (par image)Dollars US
Par défaut4.5$0.045

Paramètres

ChampTypeValeur par défautValeurs admisesRôle
promptObligatoirestring—jusqu’à 5 000 caractèresDescribe the image to produce from the source: subject, composition, style, and lighting.
image_urlsObligatoirearray<string (uri)>—jusqu’à 9 élémentsSource images that you are authorised to process.
bounding_boxesFacultatifarray<object>—jusqu’à 18 élémentsRectangles marking the areas to edit, in pixels from the top-left corner of the reference image each one belongs to. Up to 2 per image.
aspect_ratioFacultatifstring—1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3Aspect ratio of the generated image. Omit it to follow the proportions of the last source image.
num_outputsFacultatifinteger1de 1 à 4How many images to generate in one run.
resolutionFacultatifstring1k1k, 2kOutput resolution tier. With aspect_ratio omitted, the output follows the last source image's proportions at this tier.
color_paletteFacultatifarray<object>—jusqu’à 10 élémentsCustom colour theme: 3 to 10 colours, each with an optional share of the image in percent. Leave the shares empty to split them evenly.
seedFacultatifinteger—de 0 à 2147483647Random seed. Omit to let the model pick one.

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/wan-2.7/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