# Flux 2 Klein Realtime

> Flux 2 Klein Realtime API endpoint


## Overview

- **Endpoint**: `https://fal.run/fal-ai/flux-2-klein-realtime/realtime`
- **Model ID**: `fal-ai/flux-2-klein-realtime/realtime`
- **Category**: unknown
- **Kind**: inference


## Pricing

- **Price**: $0.00194 per compute seconds

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:


- **`image_size`** (`ImageSizeEnum`, _optional_):
  The size of the generated image. square=768x768, square_hd=1024x1024. Default value: `"square"`
  - Default: `"square"`
  - Options: `"square"`, `"square_hd"`

- **`schedule_mu`** (`float`, _optional_):
  Schedule mu for time shift. 2.3=default, lower=more even denoising, 0.3=nearly linear. Default value: `2.3`
  - Default: `2.3`
  - Range: `0.3` to `2.5`

- **`output_feedback_strength`** (`float`, _optional_):
  Output feedback loop. 1.0 = pure noise (no feedback), 0.9 = 90% noise + 10% previous output latent. Default value: `1`
  - Default: `1`
  - Range: `0` to `1`

- **`prompt`** (`string`, _optional_):
  The prompt to guide image editing. Default value: `"Turn this into "Living oil painting, melting gold and sapphire""`
  - Default: `"Turn this into \"Living oil painting, melting gold and sapphire\""`
  - Examples: "Turn this into a watercolor painting"

- **`image_url`** (`string`, _required_):
  Base64-encoded image data URI for editing. CDN URLs are not supported for realtime. For optimal performance, use 704x704 JPEG images with 50% quality. Other sizes will be resized automatically.

- **`num_inference_steps`** (`integer`, _optional_):
   Default value: `3`
  - Default: `3`
  - Range: `1` to `8`

- **`enable_interpolation`** (`boolean`, _optional_):
  Enable RIFE frame interpolation between consecutive frames (doubles output frames).
  - Default: `false`

- **`seed`** (`integer`, _optional_):
  Random seed for reproducibility. Default value: `35`
  - Default: `35`



**Required Parameters Example**:

```json
{
  "image_url": ""
}
```

**Full Example**:

```json
{
  "image_size": "square",
  "schedule_mu": 2.3,
  "output_feedback_strength": 1,
  "prompt": "Turn this into a watercolor painting",
  "image_url": "",
  "num_inference_steps": 3,
  "seed": 35
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<RawImage>`, _required_):
  Generated images as raw bytes. When interpolation is enabled, returns [interpolated_frame, current_frame] in chronological order. Otherwise returns [current_frame].
  - Array of RawImage

- **`seed`** (`integer`, _required_):
  Seed used for generation.



**Example Response**:

```json
{
  "images": [
    {
      "content_type": "image/jpeg",
      "content": ""
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request WEBSOCKET \
  --url https://fal.run/fal-ai/flux-2-klein-realtime/realtime \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": ""
   }'
```

### 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(
    "fal-ai/flux-2-klein-realtime/realtime",
    arguments={
        "image_url": ""
    },
    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("fal-ai/flux-2-klein-realtime/realtime", {
  input: {
    image_url: ""
  },
  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);
```


## Deploy your own model

To run your own weights, a fine-tune or a custom pipeline on the GPUs that serve this API, deploy it on fal Serverless. GPUs from H100 (80GB) to B300 (288GB), billed per second; an H100 is $4.50/h list, as low as $2.49/h. Prices, GPU specs and deploy steps: [fal Serverless](https://fal.ai/serverless.md).

## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/flux-2-klein-realtime/realtime)
- [API Documentation](https://fal.ai/models/fal-ai/flux-2-klein-realtime/realtime/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/flux-2-klein-realtime/realtime)

### 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
- [Pricing](https://fal.ai/pricing.md): Model API and Serverless GPU prices
- [fal Serverless](https://fal.ai/serverless.md): Deploy your own models: GPU prices, specs and steps
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
