PopNowDocs de la API
Contenido principal

Referencia de la API de FLUX.2 Klein 9B LoRA

FLUX.2 Klein 9B rápido que carga hasta tres de tus LoRA

Con una sola clave de API de PopNow puedes llamar a FLUX.2 Klein 9B LoRA desde tu propio código. Aquí tienes los ID de modelo que debes enviar, cada campo de entrada que acepta, cuántos créditos cuesta cada solicitud y una petición que puedes pegar tal cual en la terminal.

Las descripciones de los parámetros vienen del esquema de entrada del modelo y solo están en inglés.

De un vistazo

Creado por
Black Forest Labs
Resultado
Imagen
Desde
2.7 créditos por imagen ($0.027)
Tiempo habitual
unos 16 s

1 crédito = 0,01 US$. Al aceptarse, la tarea retiene el cargo máximo posible y al terminar cobra el uso real, redondeado al crédito superior; el resto se libera. Las tareas fallidas no se cobran. Para saber la cifra exacta antes de ejecutar, llama a POST /api/v1/jobs/quote.

Crear imagen

black-forest-labs/flux-2-klein-9b-lora/text-to-image

Precio

OpciónCréditos (por imagen)Dólares
Predeterminado2.7$0.027

Parámetros

CampoTipoValor predeterminadoValores admitidosPara qué sirve
promptObligatoriostring—hasta 5000 caracteresDescribe the subject, setting, light and style in plain sentences. Put a LoRA trigger phrase first.
aspect_ratioOpcionalstring1:11:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21Output aspect ratio.
resolutionOpcionalstring1k1k, 2kOutput size tier: 1k is about one megapixel, 2k is 2048 pixels on the long side.
lorasOpcionalarray<object>[]hasta 3 elementosUp to three LoRA weight files trained for FLUX.2 [klein] 9B (the distilled or the Base build), each with its own strength.
seedOpcionalinteger—de 0 a 2147483647Random seed for controlled comparisons.

Solicitud de ejemplo

Esta solicitud funciona tal cual; los campos que no envíes usan su valor predeterminado. Antes, guarda tu clave en 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": "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 respuesta trae un taskId al instante. Consulta el resultado con GET /api/v1/jobs/recordInfo o añade callBackUrl para recibir un aviso.

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"

Editar imagen

black-forest-labs/flux-2-klein-9b-lora/edit

Precio

OpciónCréditos (por imagen)Dólares
Predeterminado3.78$0.0378

Parámetros

CampoTipoValor predeterminadoValores admitidosPara qué sirve
promptObligatoriostring—hasta 5000 caracteresSay what to change and what must stay the same. Put a LoRA trigger phrase first.
image_urlsObligatorioarray<string (uri)>—hasta 3 elementosOne to three source images, in the order your prompt refers to them.
aspect_ratioOpcionalstringautoauto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21Output aspect ratio; auto keeps the shape of the first source image.
resolutionOpcionalstring1k1k, 2kOutput size tier when you choose an aspect ratio; with auto the result keeps the shape of the first source image at about one megapixel.
lorasOpcionalarray<object>[]hasta 3 elementosUp to three LoRA weight files trained for FLUX.2 [klein] 9B (the distilled or the Base build), each with its own strength.
seedOpcionalinteger—de 0 a 2147483647Random seed for controlled comparisons.

Solicitud de ejemplo

Esta solicitud funciona tal cual; los campos que no envíes usan su valor predeterminado. Antes, guarda tu clave en POPNOW_API_KEY.

El ejemplo usa archivos de muestra de PopNow en image_urls. Cámbialos por tus propios enlaces HTTPS públicos, archivos subidos o recursos guardados.

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-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 respuesta trae un taskId al instante. Consulta el resultado con GET /api/v1/jobs/recordInfo o añade callBackUrl para recibir un aviso.

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"

Siguientes pasos

En esta página