Référence API de FLUX.2 Klein 9B LoRA
FLUX.2 Klein 9B rapide, jusqu’à trois de tes LoRA
Une seule clé API PopNow suffit pour appeler FLUX.2 Klein 9B 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
- 2.7 crédits par image ($0.027)
- Durée habituelle
- environ 16 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
black-forest-labs/flux-2-klein-9b-lora/text-to-image
Prix
| Option | Crédits (par image) | Dollars US |
|---|---|---|
Par défaut | 2.7 | $0.027 |
Paramètres
| Champ | Type | Valeur par défaut | Valeurs admises | Rôle |
|---|---|---|---|---|
promptObligatoire | string | — | jusqu’à 5 000 caractères | Describe the subject, setting, light and style in plain sentences. Put a LoRA trigger phrase first. |
aspect_ratioFacultatif | string | 1:1 | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21 | Output aspect ratio. |
resolutionFacultatif | string | 1k | 1k, 2k | Output size tier: 1k is about one megapixel, 2k is 2048 pixels on the long side. |
lorasFacultatif | array<object> | [] | jusqu’à 3 éléments | Up to three LoRA weight files trained for FLUX.2 [klein] 9B (the distilled or the Base build), each with its own strength. |
seedFacultatif | integer | — | de 0 à 2147483647 | Random 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.
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-2-klein-9b-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.
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-2-klein-9b-lora/edit
Prix
| Option | Crédits (par image) | Dollars US |
|---|---|---|
Par défaut | 3.78 | $0.0378 |
Paramètres
| Champ | Type | Valeur par défaut | Valeurs admises | Rôle |
|---|---|---|---|---|
promptObligatoire | string | — | jusqu’à 5 000 caractères | Say what to change and what must stay the same. Put a LoRA trigger phrase first. |
image_urlsObligatoire | array<string (uri)> | — | jusqu’à 3 éléments | One to three source images, in the order your prompt refers to them. |
aspect_ratioFacultatif | string | auto | auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21 | Output aspect ratio; auto keeps the shape of the first source image. |
resolutionFacultatif | string | 1k | 1k, 2k | Output size tier when you choose an aspect ratio; with auto the result keeps the shape of the first source image at about one megapixel. |
lorasFacultatif | array<object> | [] | jusqu’à 3 éléments | Up to three LoRA weight files trained for FLUX.2 [klein] 9B (the distilled or the Base build), each with its own strength. |
seedFacultatif | integer | — | de 0 à 2147483647 | Random 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.
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-2-klein-9b-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_urls": [
"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.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
