# FLUX.3 Klein

> Generates images from text prompts with FLUX.3 Klein, with configurable image size, reproducible seeds, prompt expansion and optional bounding-box layout control.


## Overview

- **Endpoint**: `https://fal.run/blackforestlabs/flux-3/klein/text-to-image`
- **Model ID**: `blackforestlabs/flux-3/klein/text-to-image`
- **Category**: text-to-image
- **Kind**: inference
**Description**: FLUX.3 Klein generates images from detailed text prompts. It supports configurable image dimensions, up to four outputs per request, reproducible seeds and PNG, JPEG or WebP output. Optional prompt expansion develops the caption before generation, while labeled bounding boxes provide spatial layout control. The standard endpoint defaults to 12 inference steps.

**Tags**: image generation, text to image, typography, graphic design, flux



## Pricing

Planned per-image pricing by output resolution: **768×768: $0.008**, **1K: $0.009**, **1.5K: $0.011**, **2K: $0.014**, and **4K: $0.036**. The same schedule is planned for text-to-image generation and image editing.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`prompt`** (`string`, _required_):
  The prompt to generate an image from. The model is trained on detailed captions: describe framing, subject, background and lighting.
  - Examples: "A red fox standing in fresh snow at sunrise, its breath visible in the cold air. Soft golden light rakes across the snowfield from the left, pine forest softly blurred in the background, shot at eye level with a telephoto lens."

- **`enable_prompt_expansion`** (`boolean`, _optional_):
  If set to true, the prompt is expanded into a detailed caption (grounded in the reference images when editing) before generation. Default value: `true`
  - Default: `true`

- **`seed`** (`integer`, _optional_):
  The same seed and the same prompt given to the same version of the model will output the same image every time.

- **`num_images`** (`integer`, _optional_):
  The number of images to generate. Default value: `1`
  - Default: `1`
  - Range: `1` to `4`

- **`enable_safety_checker`** (`boolean`, _optional_):
  If set to true, the safety checker will be enabled. Default value: `true`
  - Default: `true`

- **`output_format`** (`OutputFormatEnum`, _optional_):
  The format of the generated image. Default value: `"png"`
  - Default: `"png"`
  - Options: `"jpeg"`, `"png"`, `"webp"`

- **`sync_mode`** (`boolean`, _optional_):
  If `True`, the media will be returned as a data URI and the output data won't be available in the request history.
  - Default: `false`

- **`image_size`** (`ImageSize | Enum`, _optional_):
  The size of the generated image. Each side can be 256 to 4096 pixels (native 4K). Default value: `square_hd`
  - Default: `"square_hd"`
  - One of: ImageSize | Enum

- **`bounding_boxes`** (`list<BoundingBox>`, _optional_):
  Optional layout: draw each described object inside its box. Box edges are fractions of the image size, with (0, 0) at the top-left. Name boxes in the prompt by label, e.g. `A red fox <fox> sits under a red umbrella <umbrella>`.
  - Array of BoundingBox



**Required Parameters Example**:

```json
{
  "prompt": "A red fox standing in fresh snow at sunrise, its breath visible in the cold air. Soft golden light rakes across the snowfield from the left, pine forest softly blurred in the background, shot at eye level with a telephoto lens."
}
```

**Full Example**:

```json
{
  "prompt": "A red fox standing in fresh snow at sunrise, its breath visible in the cold air. Soft golden light rakes across the snowfield from the left, pine forest softly blurred in the background, shot at eye level with a telephoto lens.",
  "enable_prompt_expansion": true,
  "num_images": 1,
  "enable_safety_checker": true,
  "output_format": "png",
  "image_size": "square_hd",
  "bounding_boxes": [
    {
      "label": "fox",
      "description": "a red fox with thick orange fur and a white-tipped tail",
      "box": {
        "x_min": 0.3,
        "y_min": 0.4,
        "x_max": 0.7,
        "y_max": 0.9
      }
    }
  ]
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<ImageFile>`, _required_):
  The generated images.
  - Array of ImageFile

- **`timings`** (`Timings`, _required_):
  The timings of the generation process.

- **`seed`** (`integer`, _required_):
  Seed used to generate the first image.

- **`has_nsfw_concepts`** (`list<boolean>`, _required_):
  Whether the generated images contain NSFW concepts.
  - Array of boolean

- **`prompt`** (`string`, _required_):
  The prompt used for generating the image.



**Example Response**:

```json
{
  "images": [
    {
      "url": "",
      "content_type": "image/png",
      "file_name": "z9RV14K95DvU.png",
      "file_size": 4404019
    }
  ],
  "prompt": ""
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/blackforestlabs/flux-3/klein/text-to-image \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "A red fox standing in fresh snow at sunrise, its breath visible in the cold air. Soft golden light rakes across the snowfield from the left, pine forest softly blurred in the background, shot at eye level with a telephoto lens."
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "blackforestlabs/flux-3/klein/text-to-image",
    arguments={
        "prompt": "A red fox standing in fresh snow at sunrise, its breath visible in the cold air. Soft golden light rakes across the snowfield from the left, pine forest softly blurred in the background, shot at eye level with a telephoto lens."
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("blackforestlabs/flux-3/klein/text-to-image", {
  input: {
    prompt: "A red fox standing in fresh snow at sunrise, its breath visible in the cold air. Soft golden light rakes across the snowfield from the left, pine forest softly blurred in the background, shot at eye level with a telephoto lens."
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/blackforestlabs/flux-3/klein/text-to-image)
- [API Documentation](https://fal.ai/models/blackforestlabs/flux-3/klein/text-to-image/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=blackforestlabs/flux-3/klein/text-to-image)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
