# Krea 3 Trainer

> Train a Krea 3 text-to-image LoRA on your own images.


## Overview

- **Endpoint**: `https://fal.run/krea/v3/trainer`
- **Model ID**: `krea/v3/trainer`
- **Category**: training
- **Kind**: training
**Description**: Train a LoRA on the Krea 3. training_data_url: a ZIP of PNG/JPG/WebP images. Each ZIP sample is ROOT.EXT with an optional ROOT.txt caption. Options: trigger_phrase (caption for samples without one), resolution (1024, 1536 or 2048; default 1024), number_of_steps (50 to 10,000; default 1000), learning_rate (default 1e-4). Output: training_artifact (the LoRA, .safetensors) and its training reports. Use the LoRA with krea/v3/text-to-image/lora.

**Tags**: lora, training, text-to-image, krea, krea-3



## Pricing

Your request will cost **$0.004** per training step at 1024 and **$0.009** per training step at 1536 (minimum of 100 steps is charged). 1000 steps cost **$4.00** at 1024 and **$9.00** at 1536.

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:


- **`training_data_url`** (`string`, _optional_):
  ZIP of training images (PNG/JPG/JPEG/WebP). Text-to-image: ROOT.EXT with optional ROOT.txt caption. Edit: ROOT_start.EXT (up to 8 as ROOT_start2.EXT, ...) and ROOT_end.EXT with an optional ROOT.txt instruction. An optional ROOT.json sidecar {"source_id": ...} groups samples for the validation split.

- **`trigger_phrase`** (`string`, _optional_):
  Caption for every sample without one. Required when any sample lacks one. Default value: `""`
  - Default: `""`

- **`resolution`** (`ResolutionEnum`, _optional_):
  Training area: samples keep their aspect ratio at about resolution x resolution pixels and are never upscaled. 1536 is billed 2.25x (its pixel area). Default value: `"1024"`
  - Default: `1024`
  - Options: `1024`, `1536`

- **`number_of_steps`** (`integer`, _optional_):
  Successful optimizer updates, excluding skipped batches. Default value: `1000`
  - Default: `1000`
  - Range: `50` to `10000`

- **`learning_rate`** (`float`, _optional_):
  AdamW learning rate after warmup. Default value: `0.0001`
  - Default: `0.0001`

- **`enable_safety_checker`** (`boolean`, _optional_):
  Enable safety checks for training media. Disabling requires account permission. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{}
```

**Full Example**:

```json
{
  "resolution": 1024,
  "number_of_steps": 1000,
  "learning_rate": 0.0001,
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`training_artifact`** (`File`, _required_):
  The trained LoRA (.safetensors).

- **`artifact_manifest`** (`File`, _required_):
  Base model, key format, recipe and architecture of the artifact.

- **`config_file`** (`File`, _required_):
  The resolved training configuration.

- **`preprocessing_report`** (`File`, _required_):
  Ingest and preprocessing summary: samples, split, sizes, references.

- **`metrics`** (`File`, _required_):
  Final counters, validation losses and hardware.

- **`training_metrics`** (`File`, _required_):
  One JSON line per optimizer update.

- **`validation_images`** (`list<File>`, _optional_):
  Base and trained renders of held-out samples (`NN_base`, `NN_trained`).
  - Array of File

- **`seed`** (`integer`, _required_)



**Example Response**:

```json
{
  "training_artifact": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "artifact_manifest": {
    "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
  },
  "preprocessing_report": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "metrics": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "training_metrics": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "validation_images": [
    {
      "url": "",
      "content_type": "image/png",
      "file_name": "z9RV14K95DvU.png",
      "file_size": 4404019
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/krea/v3/trainer \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{}'
```

### 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(
    "krea/v3/trainer",
    arguments={},
    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("krea/v3/trainer", {
  input: {},
  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/krea/v3/trainer)
- [API Documentation](https://fal.ai/models/krea/v3/trainer/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=krea/v3/trainer)

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