by Black Forest Labs

FLUX.2 Klein 4B edit API: swap the background, light or weather behind people from 1 to 3 references, keep faces and pose, low flat price, about 31 s.

black-forest-labs/flux-2-klein-4b/edit
FLUX.2 Klein 4B AI Image Generator online
  • Up to 2K
  • Up to 3 reference images
  • 9 aspect ratios
  • Create Image
  • Edit Image

About FLUX.2 Klein 4B

FLUX.2 Klein 4B edit takes a prompt and one to three image_urls, typically in about 31 seconds.

Call it with the model name black-forest-labs/flux-2-klein-4b/edit on POST /jobs/createTask, from $0.0126.

Introduction

FLUX.2 [klein] 4B Image edit changes or combines up to three source images with a written instruction, on Black Forest Labs' smallest FLUX.2 model, which is open source under Apache 2.0. Keep the shape of your first image with auto, or choose a ratio and a 1k or 2k size tier.

Choose a mode by starting material

What you haveMode
a written descriptionFLUX.2 Klein 4B Text to image
one to three pictures to change or combineFLUX.2 Klein 4B Image edit

Key features

Up to three references

Combine two portraits and a location, or restyle a single photo.

Edits that keep people

Ask for a new background, light or weather and keep faces, clothes and pose. With one source this works cleanly; with three, faces can drift slightly.

Request parameters

ParameterRequiredDescription
aspect_ratioNoThe shape of the frame: wide, square or tall. auto · 1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · 21:9 · 9:21 · Default: auto
image_urlsYesPhotos to edit or combine. Say in the prompt what each one adds.
promptYesDescribe what you want to make.
resolutionNoChoose an available output size. 1k · 2k · Default: 1k
seedNoUse the same seed and settings for more controlled comparisons. ≥ 0 · ≤ 2147483647

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.

OptionUSD per image
Standard$0.0126

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

Background and mood swaps

Move a couple from a sunny street to a rainy neon night in one pass.

Bringing people to a place

Place two portraits in a location photo for storyboards, covers and character sheets.

Quick restyles

Change light, season or palette while the composition stays put.

Prompt guide & pro tips

Protect first, change second

Open with what must remain the same, then describe only the change. Short, concrete instructions work best.

Give each source a role

With several images, say what each one contributes: this person, that person, this place.

Check the details

With two or three sources, look at hands, hair and accessories; a small extra item can appear. Run another seed if something is off.

API quick start

Call the FLUX.2 Klein 4B API in three steps

  1. 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.
  2. Send the request. POST /jobs/createTask with model black-forest-labs/flux-2-klein-4b/edit and an input object that follows the parameter table. The response returns a task ID straight away.
  3. 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/edit",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
    "image_urls": [
      "https://media.popnow.ai/influencer/examples/marco.webp"
    ],
    "aspect_ratio": "auto",
    "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.

About the FLUX.2 Klein 4B Edit Image endpoint

Its strongest use is changing the setting behind people: a sunny street becomes a rainy neon night while faces, clothes and pose stay.

Two portraits and a place can also be merged into one scene, with faces staying close to the sources.

List everything that must stay before the change; small models need the explicit keep list.

Text and exact colours are unreliable, so avoid edits that depend on them.

Seed is supported, so try three or four seeds for an edit and pick the cleanest result. Each variation is a separate paid request.

Output stays within about 2048 pixels on the long side; aspect_ratio can be set explicitly or left to follow the first reference.

A neon night swap works best when the prompt names the new light sources, such as a red sign overhead and wet reflections on the pavement.

For merged scenes, describe where each person stands, for example side by side on a beach cabin porch at sunset, so the small model places them sensibly.

Faces stay closest to the source when the input portraits are front-facing and evenly lit.

Examples

Night market background swap
Night market background swapExamples

FLUX.2 Klein 4B API questions

How much does the FLUX.2 Klein 4B API cost?

FLUX.2 Klein 4B starts at $0.0126 per image with Edit Image, its lowest-priced task. 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 are the limits of the FLUX.2 Klein 4B · Edit Image API?

Resolutions: 1K · 2K; Aspect ratios: auto · 1:1 · 16:9 · 9:16 · 4:3 · 3:4 +4; Reference images: 3; Prompt length (characters): 5,000; Largest upload: 10 MB. Requests outside these limits are rejected before anything is charged.

More about FLUX.2 Klein 4B