> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argil.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# FLUX.2 Klein 4B

> Blazing fast FLUX.2 [klein] 4B: text to image, or a prompt-driven edit of up to 4 reference images. Better quality and text than FLUX.1 Schnell, ~3× its cost.

Model id `flux-2-klein-4b` · Black Forest Labs · image · 2 modes: `text-to-image`, `image-to-image`.

> [!NOTE]
>
> This page reflects the current catalog. Inputs, allowed values, limits and prices can change as the model evolves; the field names and their meaning do not. For the exact schema at any time, your agent calls [`get_model`](https://docs.argil.ai/v2/mcp/tools) with the mode.

## Text To Image

Mode `text-to-image`. Text to image.

### Input

| Field | Type | Required | Allowed | Default | Description |
| - | - | - | - | - | - |
| `prompt` | string | Yes | up to 5,000 characters | | Text prompt describing the image to generate or edit |
| `aspect_ratio` | string | | `1:1`, `16:9`, `9:16`, `4:3`, `3:4` | | Aspect ratio: 1:1, 16:9, 9:16, 4:3, or 3:4 |
| `image_size` | string or object | | `square_hd`, `square`, `portrait_4_3`, `portrait_16_9`, `landscape_4_3`, `landscape_16_9`, or | | Image size preset or custom \{width, height}. Overrides aspectRatio if both set. |
| `num_images` | integer | | 1 to 4 | | Number of images to generate (1-4). Defaults to 1. |
| `output_format` | string | | `jpeg`, `png`, `webp` | | Output image format. Defaults to png. |
| `seed` | integer | | | | Seed for reproducible generation |
| `negative_prompt` | string | | up to 2,000 characters | | Negative prompt — what to avoid in the image |
| `guidance_scale` | number | | 0 to 20 | | Classifier-free guidance scale (0-20). Defaults to 5. |
| `num_inference_steps` | integer | | 4 to 50 | | Inference steps (4-50). Defaults to 28. |

### Pricing

0.4355 credits per megapixel.

Fixed price: charged as estimated.

For the exact price of a request, use [`estimate_generation`](https://docs.argil.ai/v2/mcp/tools).

### Example

The arguments of [`generate_media`](https://docs.argil.ai/v2/mcp/tools#generate_media):

```json theme={null}
{
  "model": "flux-2-klein-4b",
  "mode": "text-to-image",
  "input": {
    "prompt": "Studio photo of a ceramic mug with steam, soft morning light",
    "aspect_ratio": "1:1"
  }
}
```

## Image To Image

Mode `image-to-image`. Edit up to 4 reference images, as the prompt says.

### Input

| Field | Type | Required | Allowed | Default | Description |
| - | - | - | - | - | - |
| `prompt` | string | Yes | up to 5,000 characters | | Text prompt describing the image to generate or edit |
| `aspect_ratio` | string | | `1:1`, `16:9`, `9:16`, `4:3`, `3:4` | | Aspect ratio: 1:1, 16:9, 9:16, 4:3, or 3:4 |
| `image_size` | string or object | | `square_hd`, `square`, `portrait_4_3`, `portrait_16_9`, `landscape_4_3`, `landscape_16_9`, or | | Image size preset or custom \{width, height}. Overrides aspectRatio if both set. |
| `num_images` | integer | | 1 to 4 | | Number of images to generate (1-4). Defaults to 1. |
| `output_format` | string | | `jpeg`, `png`, `webp` | | Output image format. Defaults to png. |
| `seed` | integer | | | | Seed for reproducible generation |
| `num_inference_steps` | integer | | 4 to 8 | | Inference steps (4-8). Defaults to 4. |
| `references` | [File](https://docs.argil.ai/v2/mcp/how-it-works.md#your-files) list | Yes | 1 to 4 items | | References the output must follow. The kind of each one (image, video, audio) is read from the file; per-kind limits are in the mode’s `capabilities.references`. |

**References:** up to 4: 4 images. Assets, URLs and elements are accepted.

### Pricing

0.4839 credits per megapixel.

Fixed price: charged as estimated.

For the exact price of a request, use [`estimate_generation`](https://docs.argil.ai/v2/mcp/tools).

### Example

The arguments of [`generate_media`](https://docs.argil.ai/v2/mcp/tools#generate_media):

```json theme={null}
{
  "model": "flux-2-klein-4b",
  "mode": "image-to-image",
  "input": {
    "prompt": "Studio photo of a ceramic mug with steam, soft morning light, keeping the look of the reference",
    "aspect_ratio": "1:1",
    "references": [
      "asset_91a3c7e5b2d84f6a8e0c1b9d7f3a5e24"
    ]
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.