FLUX.2 Klein 4B

FLUX_2_KLEIN_4B

Fast text-to-image model from Black Forest Labs (FLUX.2 [klein] 4B) that turns a prompt into an image in a few steps and can learn your own subject or style from 5 to 200 photos.

Image Generationtext-to-imagefluxapache-2.0Fine-tunable
FLUX.2 Klein 4B: Image Generation model on Kainguru

FLUX.2 Klein 4B inputs and output

NameTypeRequiredDefaultDetails
prompttextYes—What the image should show.
1–2000 characters
num_inference_stepsintegerNo4Denoising steps; more steps take longer.
1–8
heightintegerNo1024Image height in pixels, a multiple of 16.
256–1440
seedintegerNo—The same seed and inputs give the same image. Leave empty for a random seed.
0–2147483647
widthintegerNo1024Image width in pixels, a multiple of 16.
256–1440

Output. Returns PNG image: The generated image (PNG).

Run FLUX.2 Klein 4B with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=FLUX_2_KLEIN_4B" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "prompt": "example",
    "height": 1024,
    "num_inference_steps": 4,
    "width": 1024
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "FLUX_2_KLEIN_4B",
        {
          "prompt": "example",
          "height": 1024,
          "num_inference_steps": 4,
          "width": 1024
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune FLUX.2 Klein 4B

You can fine-tune FLUX.2 Klein 4B on your own data and run the tuned model through the same API. Dataset: 5 to 200 images of one subject or style (PNG, JPEG or WebP, up to 20 MB each).

The steps are in the docs.

FLUX.2 Klein 4B pricing

Price per image: 0.095 credits ($0.00095). The price is shown again before every run; all prices are on the pricing page.

ERNIE-Image: Image Generation model on Kainguru
Image Generation

ERNIE-Image

ERNIE-Image from Baidu: an 8B text-to-image model strong on posters, dense text and multi-panel layouts in English and…

Fine-tunable
Kandinsky 2.2: Image Generation model on Kainguru
Image Generation

Kandinsky 2.2

Kandinsky 2.2: a fast text-to-image model for illustrations and photos, with negative prompts and adjustable guidance…

Fine-tunable
LongCat-Image: Image Generation model on Kainguru
Image Generation

LongCat-Image

LongCat-Image from Meituan: a 6B text-to-image model for photoreal scenes with legible Chinese and English text, with…

Fine-tunable
PRX Pixel: Image Generation model on Kainguru
Image Generation

PRX Pixel

PRX Pixel from Photoroom: a 7B text-to-image model that paints directly in pixels (no latent decoder), with negative…

Fine-tunable
Qwen-Image-2512: Image Generation model on Kainguru
Image Generation

Qwen-Image-2512

Qwen-Image-2512 from Alibaba's Qwen team: a 20B text-to-image model with accurate English and Chinese text rendering…

Fine-tunable
Z-Image: Image Generation model on Kainguru
Image Generation

Z-Image

Z-Image from Alibaba's Tongyi Lab: the full 6B text-to-image model, with negative prompts and adjustable guidance for…

Fine-tunable