# LTX-2.3 22B Video Trainer

> Train LTX-2.3 22B for custom styles and effects.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/ltx23-video-trainer`
- **Model ID**: `fal-ai/ltx23-video-trainer`
- **Category**: training
- **Kind**: training
**Tags**: ltx2.3-video, fine-tuning



## Pricing

Your request will cost **$0.0048 per step.** For example, the default 2000-step training will cost **$9.60.**

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`, _required_):
  URL to zip archive with videos or images. Try to use at least 10 files, although more is better.
  
  **Supported video formats:** .mp4, .mov, .avi, .mkv
  **Supported image formats:** .png, .jpg, .jpeg
  
  Note: The dataset must contain ONLY videos OR ONLY images - mixed datasets are not supported.
  
  The archive can also contain text files with captions. Each text file should have the same name as the media file it corresponds to.

- **`rank`** (`RankEnum`, _optional_):
  The rank of the LoRA adaptation. Higher values increase capacity but use more memory. Default value: `"32"`
  - Default: `32`
  - Options: `8`, `16`, `32`, `64`, `128`
  - Examples: 32

- **`number_of_steps`** (`integer`, _optional_):
  The number of training steps. Default value: `2000`
  - Default: `2000`
  - Range: `100` to `20000`
  - Examples: 2000

- **`learning_rate`** (`float`, _optional_):
  Learning rate for optimization. Higher values can lead to faster training but may cause overfitting. Default value: `0.0002`
  - Default: `0.0002`
  - Range: `0.000001` to `1`
  - Examples: 0.0002

- **`number_of_frames`** (`integer`, _optional_):
  Number of frames per training sample. Must satisfy frames % 8 == 1 (e.g., 1, 9, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97). Default value: `89`
  - Default: `89`
  - Range: `9` to `121`
  - Examples: 89

- **`frame_rate`** (`integer`, _optional_):
  Target frames per second for the video. Default value: `25`
  - Default: `25`
  - Range: `8` to `60`
  - Examples: 25

- **`resolution`** (`ResolutionEnum`, _optional_):
  Resolution to use for training. Higher resolutions require more memory. Default value: `"medium"`
  - Default: `"medium"`
  - Options: `"low"`, `"medium"`, `"high"`
  - Examples: "medium"

- **`aspect_ratio`** (`AspectRatioEnum`, _optional_):
  Aspect ratio to use for training. Default value: `"1:1"`
  - Default: `"1:1"`
  - Options: `"16:9"`, `"1:1"`, `"9:16"`
  - Examples: "1:1"

- **`trigger_phrase`** (`string`, _optional_):
  A phrase that will trigger the LoRA style. Will be prepended to captions during training. Default value: `""`
  - Default: `""`
  - Examples: ""

- **`auto_scale_input`** (`boolean`, _optional_):
  If true, videos will be automatically scaled to the target frame count and fps. This option has no effect on image datasets.
  - Default: `false`
  - Examples: false

- **`split_input_into_scenes`** (`boolean`, _optional_):
  If true, videos above a certain duration threshold will be split into scenes. Default value: `true`
  - Default: `true`
  - Examples: true

- **`split_input_duration_threshold`** (`float`, _optional_):
  The duration threshold in seconds. If a video is longer than this, it will be split into scenes. Default value: `30`
  - Default: `30`
  - Range: `1` to `60`
  - Examples: 30

- **`debug_dataset`** (`boolean`, _optional_):
  When enabled, the trainer returns a downloadable archive of your preprocessed training data for manual inspection. Use this to verify that your videos, images, and captions were processed correctly before committing to a full training run.
  - Default: `false`

- **`with_audio`** (`boolean`, _optional_):
  Enable joint audio-video training. If None (default), automatically detects whether input videos have audio. Set to True to force audio training, or False to disable.

- **`audio_normalize`** (`boolean`, _optional_):
  Normalize audio peak amplitude to a consistent level. Recommended for consistent audio levels across the dataset. Default value: `true`
  - Default: `true`

- **`audio_preserve_pitch`** (`boolean`, _optional_):
  When audio duration doesn't match video duration, stretch/compress audio without changing pitch. If disabled, audio is trimmed or padded with silence. Default value: `true`
  - Default: `true`

- **`first_frame_conditioning_p`** (`float`, _optional_):
  Probability of conditioning on the first frame during training. Higher values improve image-to-video performance. Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`validation`** (`list<Validation>`, _optional_):
  A list of validation prompts to use during training. When providing an image, _all_ validation inputs must have an image.
  - Default: `[]`
  - Array of Validation

- **`validation_negative_prompt`** (`string`, _optional_):
  A negative prompt to use for validation. Default value: `"worst quality, inconsistent motion, blurry, jittery, distorted"`
  - Default: `"worst quality, inconsistent motion, blurry, jittery, distorted"`

- **`validation_number_of_frames`** (`integer`, _optional_):
  The number of frames in validation videos. Default value: `89`
  - Default: `89`
  - Range: `9` to `121`
  - Examples: 89

- **`validation_frame_rate`** (`integer`, _optional_):
  Target frames per second for validation videos. Default value: `25`
  - Default: `25`
  - Range: `8` to `60`
  - Examples: 25

- **`validation_resolution`** (`ValidationResolutionEnum`, _optional_):
  The resolution to use for validation. Default value: `"high"`
  - Default: `"high"`
  - Options: `"low"`, `"medium"`, `"high"`
  - Examples: "high"

- **`validation_aspect_ratio`** (`ValidationAspectRatioEnum`, _optional_):
  The aspect ratio to use for validation. Default value: `"1:1"`
  - Default: `"1:1"`
  - Options: `"16:9"`, `"1:1"`, `"9:16"`
  - Examples: "1:1"

- **`stg_scale`** (`float`, _optional_):
  STG (Spatio-Temporal Guidance) scale. 0.0 disables STG. Recommended value is 1.0. Default value: `1`
  - Default: `1`
  - Range: `0` to `3`

- **`generate_audio_in_validation`** (`boolean`, _optional_):
  Whether to generate audio in validation samples. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{
  "training_data_url": ""
}
```

**Full Example**:

```json
{
  "training_data_url": "",
  "rank": 32,
  "number_of_steps": 2000,
  "learning_rate": 0.0002,
  "number_of_frames": 89,
  "frame_rate": 25,
  "resolution": "medium",
  "aspect_ratio": "1:1",
  "trigger_phrase": "",
  "auto_scale_input": false,
  "split_input_into_scenes": true,
  "split_input_duration_threshold": 30,
  "audio_normalize": true,
  "audio_preserve_pitch": true,
  "first_frame_conditioning_p": 0.5,
  "validation": [],
  "validation_negative_prompt": "worst quality, inconsistent motion, blurry, jittery, distorted",
  "validation_number_of_frames": 89,
  "validation_frame_rate": 25,
  "validation_resolution": "high",
  "validation_aspect_ratio": "1:1",
  "stg_scale": 1,
  "generate_audio_in_validation": true
}
```


### Output Schema

The API returns the following output format:

- **`video`** (`File`, _optional_):
  The URL to the validation videos, if any.

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

- **`config_file`** (`File`, _required_):
  Configuration used for setting up inference endpoints.

- **`debug_dataset`** (`File`, _optional_):
  A downloadable archive containing the preprocessed training data, including decoded videos and audio. Only present when `debug_dataset` is enabled in the input.



**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/fal-ai/ltx23-video-trainer \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "training_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(
    "fal-ai/ltx23-video-trainer",
    arguments={
        "training_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("fal-ai/ltx23-video-trainer", {
  input: {
    training_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/fal-ai/ltx23-video-trainer)
- [API Documentation](https://fal.ai/models/fal-ai/ltx23-video-trainer/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/ltx23-video-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)
