PopNowDocs API
Contenu principal

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

Contrôle par pose, profondeur ou contours sur FLUX.1, avec tes LoRA

Une seule clé API PopNow suffit pour appeler FLUX.1 Dev ControlNet 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
Black Forest Labs
Résultat
Image
À partir de
5.4 crédits par image ($0.054)

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

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

Prix

OptionCrédits (par image)Dollars US
Par défaut5.4$0.054

Paramètres

ChampTypeValeur par défautValeurs admisesRôle
promptObligatoirestring—jusqu’à 5 000 caractèresDescribe the picture you want: subject, clothing, setting and light. The control image only sets the layout.
control_image_urlObligatoirestring (uri)——Control image: a pose skeleton, depth map, canny or soft-edge line map, or a grayscale or plain photo. The result keeps its aspect ratio.
control_strengthFacultatifnumber0.7de 0 à 1How strongly the result follows the control image, from 0 to 1.
control_guidance_startFacultatifnumber0de 0 à 1Fraction of the denoising steps at which the control image starts to apply, from 0 to 1.
control_guidance_endFacultatifnumber0.8de 0 à 1Fraction of the denoising steps at which the control image stops applying, from 0 to 1; not before the start.
resolutionFacultatifstring1k1k, 1.5kLength of the output's long side: 1k is 1024 pixels, 1.5k is 1536. The control image's aspect ratio is kept.
num_outputsFacultatifinteger1de 1 à 4How many images to generate in one run, from 1 to 4.
lorasFacultatifarray<object>[]jusqu’à 3 élémentsUp to three LoRA weight files trained for FLUX.1 dev, 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 control_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": "black-forest-labs/flux-1-dev-controlnet-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",
    "control_image_url": "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