> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/ai/ai-model-hub/models/image-generation-models/flux-2-klein-4b.md).

# FLUX.2-klein-4B

**Summary:** FLUX.2-klein-4B is a compact, efficient text-to-image model developed by Black Forest Labs, designed to deliver high-quality image generation with a reduced 4B parameter footprint. Building on the FLUX architecture, the klein variant prioritises speed and resource efficiency while maintaining strong visual fidelity, making it well-suited for content creation, rapid prototyping, and applications where low-latency generation is essential.

|                                            **Image quality**                                           |                                                                **Speed**                                                               |                                                                      **Sovereignty**                                                                     |                                                                 **Input**                                                                 |                                                              **Output**                                                              |
| :----------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------: |
| ![Intelligence active](/files/dnDi7yuqXqkBFqwaxdnm)![Intelligence active](/files/dnDi7yuqXqkBFqwaxdnm) | ![Speed active](/files/evfYW3bq4dTBLlZH3dQf) ![Speed active](/files/evfYW3bq4dTBLlZH3dQf) ![Speed active](/files/evfYW3bq4dTBLlZH3dQf) | ![Sovereignty active](/files/bNpzGRJfez9SidEjNCoy) ![Sovereignty active](/files/bNpzGRJfez9SidEjNCoy) ![Sovereignty active](/files/bNpzGRJfez9SidEjNCoy) | ![Text active](/files/45qlqURbT8c2Ekr8HJfK) ![Image inactive](/files/0mPVwOtrYhZrpz9clC3D) ![Audio inactive](/files/PRglWWEC5Zoc5fgynNLM) | ![Model icon](/files/WcxmwJ2hD7xtBeHiOQqH) ![Model icon](/files/DNwY25ymIs7iVH2CHTv1) ![Audio inactive](/files/PRglWWEC5Zoc5fgynNLM) |
|                                                *Medium*                                                |                                                                 *High*                                                                 |                                                                          *High*                                                                          |                                                                   *Text*                                                                  |                                                                *Image*                                                               |

## Central parameters

**Description:** Compact 4B-parameter image generation model optimised for fast, high-quality visual output with low resource overhead.

**Model identifier:** `black-forest-labs/FLUX.2-klein-4B`

## IONOS CLOUD AI Model Hub lifecycle and alternatives

| <code class="expression">space.vars.ionos\_cloud</code> **start date** | **End of Life** | **Alternative** | **Successor** |
| :--------------------------------------------------------------------: | :-------------: | :-------------: | :-----------: |
|                             *June 16, 2026*                            |       N/A       |       N/A       |               |

## Origin

|                                **Provider**                               | **Country** |                           **License**                           | **Flavor** | **Release** |
| :-----------------------------------------------------------------------: | :---------: | :-------------------------------------------------------------: | :--------: | :---------: |
| [<mark style="color:blue;">**Black Forest Labs**</mark>](https://bfl.ai/) |   Germany   | [<mark style="color:blue;">**License**</mark>](https://bfl.ai/) |    Base    |    *TBD*    |

## Technology

| **Input Length** | **Iterations** | **Quantization** | **Multilingual** |                                      **Further details**                                      |
| :--------------: | :------------: | :--------------: | :--------------: | :-------------------------------------------------------------------------------------------: |
|       *256*      |       *4*      |      *8bit*      |       *Yes*      | [<mark style="color:blue;">**Hugging Face**</mark>](https://huggingface.co/black-forest-labs) |

## Modalities

| **Text** | **Image** |   **Audio**   |
| :------: | :-------: | :-----------: |
|   Input  |   Output  | Not supported |

## Endpoints

| **Chat Completions** | **Embeddings** |  **Image generation** | **Image editing** |
| :------------------: | :------------: | :-------------------: | :---------------: |
|     Not supported    |  Not supported | v1/images/generations |  v1/images/edits  |

## Features

| **Streaming** | **Reasoning** | **Tool calling** | **Image editing** |
| :-----------: | :-----------: | :--------------: | :---------------: |
| Not supported | Not supported |   Not supported  |     Supported     |

## Usage example

| **Parameter**   | **Values**                                                                                                                                                                                               |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `n`             | `1`–`10`                                                                                                                                                                                                 |
| `output_format` | `jpg`, `jpeg`, `png`, `webp`                                                                                                                                                                             |
| `size`          | `"widthxheight"` format — both dimensions must be multiples of 16 and between 64–2048. Default: `"1024x1024"`. Example values: `"1024x1024"`, `"1536x1024"`, `"1024x1536"`, `"2048x2048"`, `"2048x1152"` |

### Generate an Image

The following example demonstrates how to generate an image using **FLUX.2-klein-4B**.

**API Endpoint:** `POST https://openai.inference.de-txl.ionos.com/v1/images/generations`

**Request:**

```json
{
  "model": "black-forest-labs/FLUX.2-klein-4B",
  "prompt": "A futuristic city with flying cars at sunset",
  "n": 1,
  "size": "1024x1024",
  "output_format": "jpeg"
}
```

**Response:**

```json
{
  "created": 1589478378,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
    }
  ]
}
```

### Edit an image

The following example demonstrates how to edit an image using **FLUX.2-klein-4B**.

**API Endpoint:** `POST https://openai.inference.de-txl.ionos.com/v1/images/edits`

**Request format:** `multipart/form-data`

**Request:**

```json
{
  "model": "black-forest-labs/FLUX.2-klein-4B",
  "prompt": "Add a rainbow in the sky above the cityscape",
  "url": "https://example.com/cityscape.png",
  "n": 1,
  "size": "1024x1024",
  "response_format": "b64_json"
}
```

**Response:**

```json
{
  "created": 1589478378,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
    }
  ]
}
```

## Rate limits

Rate limits ensure fair usage and reliable access to the AI Model Hub. In addition to the [<mark style="color:blue;">contract-wide rate limits</mark>](/cloud/ai/ai-model-hub/how-tos/rate-limits.md), the following rate limits apply:

| **Endpoint or Scope** | **Limit**                | **Notes**                                                                                    |
| --------------------- | ------------------------ | -------------------------------------------------------------------------------------------- |
| Image generation      | 10 images/minute (base)  | Additional limit specifically for images                                                     |
|                       | 20 images/minute (burst) | Short bursts allowed; after a burst, burst quota refills at the base rate (10 images/minute) |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/ai/ai-model-hub/models/image-generation-models/flux-2-klein-4b.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
