PopNowDocs API
Contenu principal

Référence API de FLUX.1 Dev LoRA

Le classique FLUX.1 Dev avec jusqu’à trois de vos LoRA

Une seule clé API PopNow suffit pour appeler FLUX.1 Dev 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 USD 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
Black Forest Labs
Résultat
Image
À partir de
$0.018 USD par image
Durée habituelle
environ 19 s

Les prix sont affichés en USD et les frais sont déduits de votre solde PopNow. Le montant maximal est réservé à la réception de la tâche, puis la consommation réelle est facturée à la fin et le solde libéré. Les tâches en échec ne sont pas facturées. Obtenez un devis exact avant de lancer avec POST /api/v1/jobs/quote.

Créer une image

black-forest-labs/flux-1-dev-lora/text-to-image

Prix

OptionUSD
Par défaut$0.018 par image

Paramètres

ChampTypeValeur par défautValeurs admisesRôle
promptObligatoirestring—jusqu’à 5 000 caractèresDescribe the subject, composition and lighting. If a LoRA has a trigger word, put it first.
aspect_ratioFacultatifstring1:11:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21Output aspect ratio.
lorasFacultatifarray<object>[]jusqu’à 3 élémentsUp to three LoRA weight files, each with its own strength.
guidance_scaleFacultatifnumber3.5de 0 à 20How closely the image follows the prompt, from 0 to 20.
stepsFacultatifinteger28de 1 à 50Denoising steps, from 1 to 50. Fewer steps return faster and a little softer.
output_formatFacultatifstringjpegjpeg, png, webpContainer of the returned image.
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": "black-forest-labs/flux-1-dev-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

black-forest-labs/flux-1-dev-lora/edit

Prix

OptionUSD
Par défaut$0.018 par image

Paramètres

ChampTypeValeur par défautValeurs admisesRôle
promptObligatoirestring—jusqu’à 5 000 caractèresDescribe the whole image you want back; with a mask, describe what belongs in the white area.
image_urlObligatoirestring (uri)——Source image to edit. The result keeps its shape.
mask_urlFacultatifstring (uri)——Optional black-and-white mask the size of the source: white areas are redrawn, black areas are kept.
strengthFacultatifnumber0.8de 0 à 1How far to move away from the source, from 0 to 1.
lorasFacultatifarray<object>[]jusqu’à 3 élémentsUp to three LoRA weight files, each with its own strength.
guidance_scaleFacultatifnumber3.5de 0 à 20How closely the image follows the prompt, from 0 to 20.
stepsFacultatifinteger28de 1 à 50Denoising steps, from 1 to 50. Fewer steps return faster and a little softer.
output_formatFacultatifstringjpegjpeg, png, webpContainer of the returned image.
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_url. 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": "black-forest-labs/flux-1-dev-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