> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.empiriolabs.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.empiriolabs.ai/_mcp/server.

# FLUX.2 Klein 4B

> Apache-licensed 4B FLUX.2 Klein image generation and editing model with text-to-image, reference-image editing, and creative workflow support.

![FLUX.2 Klein 4B](https://media.empiriolabs.ai/model-logos/flux-2-klein-4b.png)

[Black Forest Labs](/providers/black-forest-labs) · Image Generation

`POST /v1/images/generations`

Apache-licensed 4B FLUX.2 Klein image generation and editing model with text-to-image, reference-image editing, and creative workflow support.

## At a glance

| Field               | Value                                                               |
| ------------------- | ------------------------------------------------------------------- |
| Model id            | `flux-2-klein-4b`                                                   |
| Model release date  | 2026-01-15                                                          |
| Input modalities    | Text, Image                                                         |
| Output modalities   | Image                                                               |
| Context window      | -                                                                   |
| Weight precision    | BF16                                                                |
| Features            | image\_generation, image\_editing, reference\_images, seed\_control |
| Native inference    | Yes                                                                 |
| New                 | No                                                                  |
| Supported endpoints | `POST /v1/images/generations`                                       |
| Alternate model ids | `black-forest-labs/flux.2-klein-4b`, `flux.2-klein-4b`              |

## Pricing

| Charge           | Spec      | Rate                   |
| ---------------- | --------- | ---------------------- |
| Image generation | per image | \$0.0085 (was \$0.014) |

## Example request

```bash
curl https://api.empiriolabs.ai/v1/images/generations \
  -H 'Authorization: Bearer $EMPIRIOLABS_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"model": "flux-2-klein-4b", "prompt": "a misty forest at dawn", "size": "1024x1024"}'
```

## Parameters

| Parameter             | Type    | Required | Default  | Description                                                                                                                  |
| --------------------- | ------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `prompt`              | string  | yes      | -        | Text description of the image to generate.                                                                                   |
| `negative_prompt`     | string  | no       | -        | Text description of what to avoid in the image.                                                                              |
| `aspect_ratio`        | enum    | no       | `"1:1"`  | Output aspect ratio (1:1, 16:9, 9:16, 4:3, 3:2, etc.). · Allowed: `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `3:2`, `2:3`          |
| `size`                | string  | no       | -        | Explicit WIDTHxHEIGHT override. Width x height must be at most 1,048,576 pixels. Leave unset to use aspect\_ratio.           |
| `width`               | number  | no       | -        | Output width in pixels. Set width and height together. Width x height must be at most 1,048,576 pixels. · Range: 256 – 2048  |
| `height`              | number  | no       | -        | Output height in pixels. Set width and height together. Width x height must be at most 1,048,576 pixels. · Range: 256 – 2048 |
| `num_inference_steps` | number  | no       | `4`      | Number of denoising steps. Higher = better quality but slower. · Range: 1 – 12                                               |
| `guidance_scale`      | number  | no       | `1.0`    | Prompt adherence. Higher = closer to prompt but less creative. · Range: 0 – 8                                                |
| `seed`                | number  | no       | -        | Random seed for reproducibility. Same seed + prompt = same output.                                                           |
| `num_images`          | number  | no       | `1`      | How many images to generate (1-4). · Range: 1 – 4                                                                            |
| `format`              | enum    | no       | `"webp"` | Image file codec for the generated output. · Allowed: `webp`, `png`, `jpg`, `jpeg`                                           |
| `response_format`     | enum    | no       | `"url"`  | Return a signed media URL by default, or base64 JSON when requested. · Allowed: `url`, `b64_json`                            |
| `return_base64`       | boolean | no       | false    | Compatibility alias for response\_format=b64\_json.                                                                          |
| `max_sequence_length` | number  | no       | `512`    | Max prompt-token length the model conditions on. · Range: 64 – 512                                                           |
| `images`              | array   | no       | -        | Comma-separated reference image URLs for image-conditioned generation.                                                       |

## Notes

**Defaults**

* 1024x1024 image
* 4 inference steps
* Guidance scale 1.0
* WebP output

**Controls**

Supports prompt, size/aspect ratio or explicit width/height, seed, n/num\_images, and reference images. Width x height must be at most 1,048,576 pixels. Examples: 1024x1024, 1344x768, 768x1344, or 2048x512. Billing is per returned image, so `num_images: 4` creates and bills 4 images. `negative_prompt` is accepted for compatibility but ignored by the distilled Klein pipeline.

**Content safety**

* Generated images pass an automated content-safety check. An image flagged as explicit is not returned. Because the image is generated before the check runs, a flagged generation is still billed.

---

*Machine-readable schema:* `GET https://api.empiriolabs.ai/v1/models/flux-2-klein-4b`.