# FLUX 3 Klein Edit LoRA Trainer

> Fine-tune FLUX 3 Image Klein on before/after image pairs to teach it a custom edit, with up to 10 input images per pair.


## Overview

- **Endpoint**: `https://fal.run/blackforestlabs/flux-3/klein/base/trainer/edit`
- **Model ID**: `blackforestlabs/flux-3/klein/base/trainer/edit`
- **Category**: training
- **Kind**: training
**Description**: Train an editing LoRA on the FLUX 3 Image Klein base model from a .zip of edit pairs: ROOT_start.EXT (input, up to 10 as ROOT_start.EXT, ROOT_start2.EXT, ...), ROOT_end.EXT (edited result) and an optional ROOT.txt instruction; pairs without one use trigger_phrase, and pairs may have different numbers of inputs. Options: steps 100-10000 (default 1000), learning_rate (default 1e-4), resolution 512, 768 or 1024 (default 1024). Returns lora_file and config_file. Billed per training step, minimum 100 steps.

**Tags**: flux, lora, fine-tuning



## Pricing

Your request will cost **$0.002** per training step, multiplied by the reference images per pair: x2.11 with 1, x3.44 with 2, x5.09 with 3, x6.95 with 4 (up to x23.44 with 10). 1000 steps cost **$4.22** with 1 reference image and **$13.90** with 4.

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:


- **`images_data_url`** (`string`, _required_):
  URL to a .zip archive of edit pairs. Each pair is ROOT_start.EXT (the input image; up to 10 as ROOT_start.EXT, ROOT_start2.EXT, ...) and ROOT_end.EXT (the edited result), with an optional ROOT.txt edit instruction; pairs without one use `trigger_phrase`. Pairs may have different numbers of input images.

- **`trigger_phrase`** (`string`, _optional_):
  Caption for every image that ships no caption file. Required when any image lacks one. Default value: `""`
  - Default: `""`

- **`steps`** (`integer`, _optional_):
  Number of training steps. Default value: `1000`
  - Default: `1000`
  - Range: `100` to `10000`

- **`learning_rate`** (`float`, _optional_):
  Learning rate of the LoRA parameters. Default value: `0.0001`
  - Default: `0.0001`
  - Range: `0.000001` to `0.01`

- **`resolution`** (`ResolutionEnum`, _optional_):
  Training resolution. Images keep their aspect ratio and are resized to about resolution x resolution pixels. Default value: `"1024"`
  - Default: `1024`
  - Options: `512`, `768`, `1024`



**Required Parameters Example**:

```json
{
  "images_data_url": ""
}
```

**Full Example**:

```json
{
  "images_data_url": "",
  "steps": 1000,
  "learning_rate": 0.0001,
  "resolution": 1024
}
```


### Output Schema

The API returns the following output format:

- **`lora_file`** (`File`, _required_):
  URL to the trained LoRA weights.

- **`config_file`** (`File`, _required_):
  URL to the training configuration.



**Example Response**:

```json
{
  "lora_file": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "config_file": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/blackforestlabs/flux-3/klein/base/trainer/edit \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "images_data_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(
    "blackforestlabs/flux-3/klein/base/trainer/edit",
    arguments={
        "images_data_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("blackforestlabs/flux-3/klein/base/trainer/edit", {
  input: {
    images_data_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);
```


## Additional Resources

### Documentation

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

### 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`
