# Ideogram V4.0q LoRA Trainer

> Train custom LoRAs for personalization, styles or other use cases on top of Ideogram V4.


## Overview

- **Endpoint**: `https://fal.run/ideogram/v4/trainer`
- **Model ID**: `ideogram/v4/trainer`
- **Category**: training
- **Kind**: training


## Pricing

The cost of training depends on the number of steps. The formula is: 0.00675 * steps. With 1000 steps, your request will cost **$6.75**. 

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:


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

- **`default_caption`** (`string`, _optional_):
  Caption to use when an image has no caption file. If force_default_caption is true, this caption replaces all caption files.

- **`resolution`** (`string`, _optional_):
  Training image size. Use auto to pick the largest common no-upscale crop from the dataset. Images are center-cropped without upscaling. Available presets: square 1024x1024, landscape 1536x1024, portrait 1024x1536, widescreen 1920x1088, ultrawide 2048x768, phone_wallpaper 1024x1792, social_banner 1584x400. You can also pass a custom WIDTHxHEIGHT string when both values are divisible by 16. Default value: `"auto"`
  - Default: `"auto"`

- **`learning_rate`** (`float`, _optional_):
   Default value: `0.0001`
  - Default: `0.0001`
  - Range: `0.000001` to `0.01`



**Required Parameters Example**:

```json
{}
```

**Full Example**:

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


### Output Schema

The API returns the following output format:

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

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



**Example Response**:

```json
{
  "diffusers_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/ideogram/v4/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(
    "ideogram/v4/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("ideogram/v4/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);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/ideogram/v4/trainer)
- [API Documentation](https://fal.ai/models/ideogram/v4/trainer/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=ideogram/v4/trainer)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
