About FLUX.2 Klein 4B
The FLUX.2 Klein 4B API is a low-cost FLUX endpoint for drafts and background edits. Text to image costs about the same at 1K and 2K, and edits take up to three references with typical latency around 30 seconds. It is a good model for metered previews before a premium finishing pass.
Call it with the model name black-forest-labs/flux-2-klein-4b/text-to-image on POST /jobs/createTask, from $0.0093.
Introduction
FLUX.2 [klein] 4B Text to image makes one image from a written prompt on Black Forest Labs' smallest FLUX.2 model, which is open source under Apache 2.0. Choose one of nine aspect ratios at about one megapixel (1k) or up to 2048 pixels on the long side (2k) and get a JPEG back in roughly 15 to 35 seconds.
Choose a mode by starting material
| What you have | Mode |
|---|---|
| a written description | FLUX.2 Klein 4B Text to image |
| one to three pictures to change or combine | FLUX.2 Klein 4B Image edit |
Key features
Small and quick
With 4 billion parameters this is the lightest FLUX.2 model. It suits drafts, mockups and trying many ideas in a row.
Quoted text and hex colors
Short headlines in quotation marks and hex color codes are understood. Results are decent, not guaranteed: lettering can be misspelled and a color may show up on a different object than you intended.
Request parameters
| Parameter | Required | Description |
|---|---|---|
seed | No | Use the same seed and settings for more controlled comparisons. ≥ 0 · ≤ 2147483647 |
prompt | Yes | Describe what you want to make. |
resolution | No | Choose an available output size. 1k · 2k · Default: 1k |
aspect_ratio | No | The shape of the frame: wide, square or tall. 1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · 21:9 · 9:21 · Default: 1:1 |
Pricing
Prices are in USD and charged to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
| Option | USD per image |
|---|---|
| resolution 1K | $0.0093 |
| resolution 2K | $0.0099 |
Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.
Use cases
Draft before you commit
Try a dozen prompts and seeds quickly, then take the best idea to a larger model if you need more detail.
Posters and neon scenes
Event posters, ad mockups and night scenes with signs and colored light work well within this model's range.
Moody portraits
Single subjects with one clear light source come out cleanly, especially with the hands covered or out of frame.
Prompt guide & pro tips
Describe the outfit yourself
This model adds clothing on its own. Write exactly what each person wears, piece by piece, and it will follow that.
Quote text, keep it short
One or two short words in quotes are safest. If lettering looks wrong, change only the seed and run again.
Keep two-person hands simple
Hands are the first thing to fail with two people in frame. Put them on shoulders, on a railing or in gloves, or run several seeds and pick the best.
API quick start
Call the FLUX.2 Klein 4B API in three steps
- Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls are billed in USD from your PopNow balance.
- Send the request. POST /jobs/createTask with model black-forest-labs/flux-2-klein-4b/text-to-image and an input object that follows the parameter table. The response returns a task ID straight away.
- Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
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: $IDEMPOTENCY_KEY" \
-d '{
"model": "black-forest-labs/flux-2-klein-4b/text-to-image",
"input": {
"prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
"aspect_ratio": "1:1",
"resolution": "1k"
}
}'
# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $POPNOW_API_KEY"Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.
What to build with the FLUX.2 Klein 4B API
- Low-cost, metered image generation inside your app.
- Background and mood swap tools for portraits.
- Draft stages before FLUX.2 Pro or Max renders.
FLUX.2 Klein 4B parameter notes
- resolution 1k or 2k, priced nearly the same.
- image_urls on edit takes up to three references.
- seed supported; no negative prompt or steps.
- Hex colour codes in the prompt steer hue approximately.
How FLUX.2 Klein 4B API pricing adds up
Very low per-image prices; 2K costs only marginally more than 1K, and edits have their own flat price.
- resolution 1k: $0.0093 per run, $0.93 for 100 runs
- resolution 2k: $0.0099 per run, $0.99 for 100 runs
Async jobs, webhooks and rate limits
Every FLUX.2 Klein 4B request is asynchronous: createTask returns a taskId straight away, and the result arrives when the job finishes. Poll GET /jobs/recordInfo every few seconds, or pass a public https callBackUrl and verify the X-Webhook-Signature header (HMAC-SHA256 over taskId, timestamp and the body hash) before trusting the payload. Each account gets 1,000 write requests per 10 seconds; a 429 carries Retry-After. Send an Idempotency-Key with createTask so a retried request for black-forest-labs/flux-2-klein-4b/text-to-image never runs or bills twice.
Common FLUX.2 Klein 4B API errors
| errorCode | What it usually means and how to fix it |
|---|---|
invalid_request | More than three references. |
generation_failed | Misspelled text is common; retry with another seed rather than treating it as a hard failure. |
content_rejected | A refused prompt or photo. |
FLUX.2 Klein 4B API questions
How much does the FLUX.2 Klein 4B API cost?
FLUX.2 Klein 4B starts at $0.0093 per image with Create Image, its lowest-priced task. Prices by option: 1K $0.0093 per image, 2K $0.0099 per image. API usage is charged in USD to your PopNow balance. When a task is accepted, we reserve the maximum quoted amount from your PopNow balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
What is the model name for FLUX.2 Klein 4B in the API?
Put black-forest-labs/flux-2-klein-4b/text-to-image for Create Image; black-forest-labs/flux-2-klein-4b/edit for Edit Image in the model field of POST /jobs/createTask.
Is FLUX.2 Klein 4B the cheapest FLUX API?
Yes, it is the lowest-priced FLUX model in the catalog.
Does it support a seed?
Yes, on both endpoints.
How fast are Klein 4B edits?
About 30 seconds.
What are the limits of the FLUX.2 Klein 4B API?
Resolutions: 1K · 2K; Aspect ratios: 1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 +3; Prompt length (characters): 5,000. Requests outside these limits are rejected before anything is charged.
Can I try FLUX.2 Klein 4B without writing code?
Run FLUX.2 Klein 4B in the Playground without an API key, using the same PopNow balance as the website, shown in USD. Each run appears in your developer history with its matching code.
All FLUX models
FLUX.2 Klein 9B is one size up, with steadier faces and hands.
- FLUX.2 Max APITop-tier FLUX: photoreal light and exact brand colorsFrom $0.07 per image
- FLUX.3 Image APIBlack Forest Labs' photoreal model: 1024×1024 square images and 4-image editsFrom $0.0408 per image
- FLUX 3 Klein Base LoRA APIFLUX 3 Klein Base that loads your own LoRAsFrom $0.042 per image
- FLUX 3 Klein Base APIFull-quality FLUX 3 Klein images and edits up to 2KFrom $0.036 per image
- FLUX 3 APIVideo with synced sound and a quick draft tierFrom $0.30 for a 5-second clip
- FLUX.2 Klein 9B LoRA APIFast FLUX.2 Klein 9B that loads up to three of your LoRAsFrom $0.018 per image
- FLUX.2 Klein Base 9B LoRA APIUndistilled Klein 9B for varied looks with your LoRAsFrom $0.024 per image
- FLUX.2 Klein 4B LoRA APISmall, quick FLUX.2 Klein 4B with your own LoRAsFrom $0.0156 per image
- FLUX.2 Klein Base 4B LoRA APIUndistilled Klein 4B that loads your own LoRAsFrom $0.018 per image
- FLUX.2 Klein 9B APIFast FLUX edits that keep faces and poses intactFrom $0.011 per image
- FLUX.2 Klein 4B APIThe smallest, quickest FLUX for rapid draftsFrom $0.0093 per image
- FLUX.2 Dev LoRA APIFLUX.2 Dev images and edits with your own LoRAsFrom $0.0216 per image
- FLUX.2 Pro APIPhotoreal images with readable text and hex color controlFrom $0.03 per image
- FLUX.2 Flex APISpells headlines and labels exactly as writtenFrom $0.0578 per image
- FLUX.2 Dev APIOpen-weights FLUX that can merge people into one sceneFrom $0.0116 per image
- FLUX.1 Krea Dev LoRA APIPhotographic FLUX.1 Krea with your own LoRAsFrom $0.024 per image
- FLUX.1 Kontext Max APIPremium Kontext for busy scenes, detailed lettering and whole-image restylesFrom $0.056 per image
- FLUX.1 Kontext Pro APIDraw a scene from text, then edit faces, outfits and lettering in placeFrom $0.028 per image
- FLUX.1 Dev ControlNet LoRA APIPose, depth or edge control on FLUX.1 with your LoRAsFrom $0.036 per image
- FLUX.1 Fill Dev LoRA APIMasked inpainting on FLUX.1 Fill with your own LoRAsFrom $0.042 per image
- FLUX.1 Dev LoRA APIClassic FLUX.1 Dev with up to three of your LoRAsFrom $0.018 per image
- FLUX.1 Schnell LoRA APIFast FLUX.1 Schnell that loads your own LoRAsFrom $0.006 per image
More about FLUX.2 Klein 4B
- Endpoints
- FLUX.2 Klein 4B · Edit Image