Ana içeriğe atla
Model logosu

Flux.2 Klein 4B API

  • Metinden Görsele
  • Görselden Görsele
Yüklemek için dokununPNG, JPG, WEBP, GIF · Maks. 100MB
Çıktı

Oluşturulan image çıktınız burada görünecek

Güncellendi:

What is the Flux.2 Klein 4B API?

The Flux.2 Klein 4B API is live on UnificAlly as black-forest-labs/flux.2-klein-4b, from $0.0112 per image. Flux.2 Klein 4B — also searched as FLUX 2 Klein 4B or flux-2-klein-4b — is the smallest variant in the Flux.2 Klein line, sitting at about 4 billion parameters. Its openly released weights are light enough to run on consumer hardware, and the same model is available here as a hosted API with no local setup. The control surface is the same as the larger Klein 9B: a prompt, seven aspect ratios (21:9, 16:9, 4:3, 1:1, 3:4, 9:16, 9:21), four resolution presets up to 4MP, optional image_urls for reference, and an integer seed for reproducibility. Klein models skip the guidance, steps, and prompt_upsampling knobs that Flex exposes, which keeps the call shape simple and the run time short. Use 4B when you need the cheapest, fastest path through the Flux.2 family for previews, large batches, and tight iteration loops.

Flux.2 Klein 4B API specs

Model IDblack-forest-labs/flux.2-klein-4b
EndpointPOST https://api.unifically.com/v1/tasks
Request typesText-to-image, image generation with reference images
Output size0.6, 1, 2, or 4 megapixels
Aspect ratio21:9, 16:9, 4:3, 1:1, 3:4, 9:16, 9:21
Reference inputsImage URLs in image_urls
ControlsSeed
Rate at 0.6 MP$0.0112
Rate at 1 MP$0.0112
Rate at 2 MP$0.012
Rate at 4 MP$0.0128

Billing is per image, with no subscription. Each reference image adds a per-image charge on top. The Flux.2 pricing guide and the pricing page show the live rate table.

How to use the Flux.2 Klein 4B API

  1. Create an API key on the API keys page.
  2. Send a POST request to /v1/tasks with the model ID and an input object.
  3. Read the task_id from the response, then check the task until it is finished, or pass a callback URL and wait for the result.
curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "black-forest-labs/flux.2-klein-4b",
    "input": {
      "prompt": "A simple icon of a coffee cup",
      "aspect_ratio": "1:1"
    }
  }'

The Flux.2 Klein 4B API returns the task ID straight away:

{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "abc123def456",
    "status": "processing"
  }
}

Poll the task, or set a callback_url on the request. The finished task carries the image URL.

curl https://api.unifically.com/v1/tasks/{task_id} \
  -H "Authorization: Bearer YOUR_API_KEY"

Flux.2 Klein 4B API parameters

ParameterTypeDefaultWhat it does
promptstringrequiredText description of the image
aspect_ratiostring16:921:9, 16:9, 4:3, 1:1, 3:4, 9:16, or 9:21
resolutionstring1mp0.6mp, 1mp, 2mp, or 4mp
image_urlsstring[]noneReference image URLs
seedintegerrandomSeed for reproducible results
nsfw_checkbooleanfalseChecks the prompt and input images for NSFW content before generating. Off unless set to true

Klein models do not support guidance, steps, or prompt_upsampling. The Flux.2 Klein 4B API documentation has the full reference.

Key features of Flux.2 Klein 4B

Five features cover what you'll touch in a real production run.

Smallest, fastest Flux.2 variant

About 4 billion parameters. Same prompt and reference surface as Klein 9B with shorter runtime, which makes it the right pick for live previews, design tools, and bulk drafts.

Seven aspect ratios on one model

21:9, 16:9, 4:3, 1:1, 3:4, 9:16, and 9:21. Cover the same brief horizontally, vertically, and squarely without re-prompting per platform. Default is 16:9.

Four resolution presets up to 4MP

0.6mp, 1mp, 2mp, 4mp. Pick low-MP for grids and thumbnails, 4mp for final delivery files. The same prompt scales across presets without changing.

Reference image support

Pass one or more URLs as image_urls and the model uses them as guidance. Useful for keeping product geometry, character continuity, or a palette consistent across runs.

Reproducible output via seed

Pass an integer seed and the same prompt, references, aspect ratio, and resolution return the same image. Useful for regression tests and locking a result you want to keep.

What Flux.2 Klein 4B is best for

  • Real-time previews

    Fastest turnaround in the Flux.2 family. Good for design tools, live editors, and any UI where the user is waiting on the next render.

  • Thumbnail grids

    Run the same prompt at 0.6mp or 1mp across multiple seeds for a grid of candidates. Pick a winner, re-render at 4mp on a heavier variant when needed.

  • Bulk preview generation

    High-throughput placeholder imagery for design tools, CMS uploads, and prototype catalogues.

  • Cross-platform social sets

    Seven aspect ratios on one model means a brand prompt rendered at 9:16, 1:1, and 16:9 lands as a matched set in a single batch.

  • Locked iteration loops

    Pair with a fixed seed to A/B prompts one variable at a time without losing the rest of the look.

  • Reference-anchored drafts

    Pass product or character references and run a fast Klein 4B draft pass before spending money on a slower Flex or Pro render.

Flux.2 Klein 4B use cases

Wire Klein 4B into a design tool's live preview pane: the user types, the API returns a 1MP draft in seconds, and the editor shows it inline. Run a thumbnail grid by sending one prompt across six seeds at 0.6mp and presenting the matrix to a reviewer. Stand up a placeholder generator for a CMS so editorial teams have brand-consistent imagery the moment a draft post is created. Lock a winning seed and run the same prompt at 9:16, 1:1, and 16:9 for a multi-platform social set in a single batch.

SSS

Flux.2 Klein 4B hakkında sık sorulan sorular

Flux.2 Klein 4B is the smallest variant in the Flux.2 Klein line, with about 4 billion parameters. It produces images from a prompt at one of seven aspect ratios and four resolution presets, with optional reference images and a reproducible seed. The trade-off is shorter runtime in exchange for less headroom on fine detail.

Once you have an account, create a key on the API keys page and pass it as Authorization: Bearer <key> on requests to https://api.unifically.com/v1/tasks. A first Klein 4B call needs nothing more than the model ID black-forest-labs/flux.2-klein-4b and a prompt, and each image is paid from your prepaid balance.

POST to /v1/tasks with model set to black-forest-labs/flux.2-klein-4b and an input holding a required prompt plus optional aspect_ratio (default 16:9), resolution (default 1mp), image_urls and seed. Generation is asynchronous: the reply carries a task_id, and GET /v1/tasks/{task_id} or a callback_url hands back the finished image URL.

Five. prompt, aspect_ratio (21:9, 16:9, 4:3, 1:1, 3:4, 9:16, 9:21), resolution (0.6mp, 1mp, 2mp, 4mp), optional image_urls for reference, and an optional integer seed. Klein models do not expose Flux's guidance, steps, or prompt_upsampling knobs.

Seven. 21:9, 16:9, 4:3, 1:1, 3:4, 9:16, and 9:21. The default is 16:9. Useful for cross-platform sets where the same prompt has to render horizontally, vertically, and squarely.

Four. 0.6 megapixels, 1 megapixel (default), 2 megapixels, and 4 megapixels. Pick smaller resolutions for grids and thumbnails; pick 4MP for hero crops and final delivery.

Yes. Set image_urls to one or more URLs and the model uses them to guide the output. Useful for product geometry, character continuity, or palette anchoring across runs.

Yes. Pass an integer seed alongside the prompt. Re-sending the same prompt, references, aspect ratio, resolution, and seed returns the same image.

When fine detail at 2MP or 4MP matters more than the latency saving, or when the prompt covers a complex multi-element scene where extra capacity helps.

Flux.2 Klein 4B rehberleri ve karşılaştırmaları

Bu modeli çalıştırmadan önce fiyatlandırmayı, sınırları ve test edilmiş çıktıları inceleyin.