PopNowDocs API
Contenu principal

Référence API de Wan 2.1 Image LoRA

Images fixes et restylages Wan 2.1 photoréalistes avec tes LoRA

Une seule clé API PopNow suffit pour appeler Wan 2.1 Image LoRA 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)

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.1-image-lora/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 subject, the setting and the light. If a LoRA has trigger words, put them first.
aspect_ratioFacultatifstring1:11:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21Output aspect ratio.
resolutionFacultatifstring1k1k, 1.5kOutput size: 1k is about one megapixel, 1.5k puts 1536 pixels on the long edge.
lorasFacultatifarray<object>[]jusqu’à 3 élémentsUp to three LoRA weight files trained for Wan 2.1 14B, each with its own strength.
output_formatFacultatifstringjpegjpeg, png, webpContainer of the returned image.
seedFacultatifinteger—de 0 à 2147483647Random seed for controlled comparisons, not a frame-identical guarantee.

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
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/wan-2.1-image-lora/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"
  }
}'

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.1-image-lora/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 you want back, not just the change.
image_urlObligatoirestring (uri)——Source image. The result keeps its aspect ratio.
resolutionFacultatifstring1k1k, 1.5kOutput width: 1k is 1024 pixels, 1.5k is 1536. The height follows the source's shape.
strengthFacultatifnumber0.6de 0 à 1How far to move away from the source, from 0 to 1.
lorasFacultatifarray<object>[]jusqu’à 3 élémentsUp to three LoRA weight files trained for Wan 2.1 14B, each with its own strength.
output_formatFacultatifstringjpegjpeg, png, webpContainer of the returned image.
seedFacultatifinteger—de 0 à 2147483647Random seed for controlled comparisons, not a frame-identical guarantee.

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_url. Remplacez-les par vos propres liens HTTPS publics, fichiers envoyés ou ressources enregistrées.

POST /api/v1/jobs/createTask
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/wan-2.1-image-lora/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_url": "https://media.popnow.ai/influencer/examples/marco.webp"
  }
}'

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