> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnichar.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Train a LoRA locally in Omnichar Studio

> Train LoRAs for FLUX.2, Krea 2, Z-Image, MiniMax H3 and LTX-2.5 on your own GPU: the training nodes, datasets, recommended settings and what fits on which card.

Omnichar Studio trains LoRAs on your own GPU, with no cloud step. The training nodes sit on the same canvas as everything else. When a run finishes, the `.safetensors` file lands in `models/loras/`, and the LoRA loader node picks it up so you can generate with it straight away.

![A MiniMax H3 LoRA training in Omnichar Studio: a Load Dataset node of captioned clips, the Train LoRA node streaming loss and peak VRAM, a live loss graph, a Resources monitor and the training settings panel](https://mintcdn.com/omnichar/UNxBLJgGOIK5Z8FS/images/lora/minimax-h3-trainer.webp?fit=max\&auto=format\&n=UNxBLJgGOIK5Z8FS\&q=85\&s=67e4dbd5d32bf7796d9cd079b084d484)

## Pick a model

| Model | Trains on | Peak VRAM at 512px | Smallest card |
| - | - | - | - |
| [FLUX.2](https://docs.omnichar.org/app/lora-training/flux-2.md) | Images | 8.6GB (klein 4B) | 12GB |
| [Z-Image](https://docs.omnichar.org/app/lora-training/z-image.md) | Images | 13.4GB | 16GB |
| [Krea 2](https://docs.omnichar.org/app/lora-training/krea-2.md) | Images | 11.9GB (4-bit) | 16GB |
| [MiniMax H3](https://docs.omnichar.org/app/lora-training/minimax-h3.md) | Images or clips | 12.7GB to 20.6GB | 16GB, slowly |
| [LTX-2.5](https://docs.omnichar.org/app/lora-training/ltx-2-5.md) | Clips | 42GB | 48GB |
| FLUX.1 dev | Images | 10.4GB (4-bit) | 12GB |

Peaks are `torch.cuda.max_memory_allocated` over 12 steps at rank 16 and batch 1, so leave headroom for the CUDA context. The 16GB figures for Z-Image, Krea 2 and MiniMax H3 were measured on a Tesla T4; the other small-card entries are interpolated from L40S runs. Training directly on a step-distilled checkpoint breaks the distillation down, so each model either trains on an undistilled base or, for Z-Image, works around it with a training adapter or De-Turbo mode.

## Install

If you installed with `--extra all`, the trainer is ready. Otherwise add the `training` extra:

```bash theme={null}
cd core
./webui.sh --install --extra training   # Windows: .\webui.bat --install --extra training
```

Training has no downloader of its own. It reuses the model files a generate node's model popup already fetched, and if a file is missing, the run stops and names it. Two things you fetch yourself: the Turbo training adapters for [Z-Image](https://docs.omnichar.org/app/lora-training/z-image.md) and [Krea 2](https://docs.omnichar.org/app/lora-training/krea-2.md), and the captioner, which downloads once the first time you press **Auto-caption**.

## The training graph

```text theme={null}
[ Load Dataset ] --> [ Caption ] --> [ Train LoRA ] --> [ Graph ]
                                          |
                                          +--> Resources (VRAM monitor)
```

* **Load Dataset** feeds a dataset downstream. The node face shows thumbnails and counts; you edit images and captions in the side panel.
* **Caption** runs a local captioner over the images that need one. Captions stay editable afterwards.
* **Train LoRA** runs the job. Its face shows a live step counter, the streaming log and a progress bar. Hyperparameters live behind the **Adjust** button.
* **Graph** plots the loss curve of the run wired into it.
* **Resources** shows CPU, RAM and VRAM. It takes no connections.

## Train your first LoRA

**1. Build a dataset**

On the **Trainer** tab, open **Datasets**, create a dataset, give it a trigger word and drag your images in. 20 to 50 images is a good range: a single character needs fewer, a broad style more.

**2. Caption it**

Run **Auto-caption** or write captions yourself. Start each one with a shared phrase, then describe the frame plainly. An uncaptioned image still trains, but against an empty prompt.

**3. Pick a model and base**

In **Adjust**, choose the architecture, then a base within it. Leave **Base precision** on Auto.

**4. Start the run**

Wire Load Dataset into Train LoRA and press **Start**. Watch the loss on the Graph node and VRAM on Resources.

**5. Generate with it**

The LoRA lands in `models/loras/`. Add a LoRA loader node, put the trigger word at the front of your prompt, and generate.

## Recommended settings

| Setting | Start with |
| - | - |
| Resolution | 512 to fit a 16GB card. A LoRA trained at 512 applies at any generation resolution. |
| Rank and alpha | 16 for a single subject, 32 for a style. Keep alpha equal to rank. |
| Steps | 1000 to 1500, roughly 30 to 40 steps per image. |
| Learning rate | 1e-4 |
| Batch size | 1 |
| Base precision | Auto |

If you hit an out-of-memory error, lower the resolution before changing anything else.

## Trigger words

The dataset's trigger word is prepended to every caption during training, so the model sees `mytoken, a photo of ...`. Put the same token at the front of your prompt to pull the LoRA in. Match the phrasing of your captions too: if they all say "an oil painting of", a prompt written the same way hits the trained style more reliably than the trigger word alone.

## Dataset and adapter options

* **LoRA scope.** *Full* adapts the attention and feed-forward layers and is stronger on short style runs. *Attention only* suits long runs, where adapting everything starts to cost prompt adherence.
* **Caption dropout** (default 0.05) trains a fraction of steps against an empty caption, so the LoRA still works when a prompt doesn't repeat the trigger word exactly.
* **Flip images** mirrors every image, doubling a small dataset. Leave it off for anything with text or a deliberate asymmetry.

## Base precision

**Base precision** freezes the base model at 4-bit (NF4) while the LoRA itself trains at full precision, so only the frozen base loses fidelity.

* **Auto** (default) sizes the base plus its activations at your resolution against your GPU, and picks.
* **Full precision (bf16)** forces the unquantized base.
* **4-bit (NF4)** forces the quantized base.

It pays off on Krea 2 and FLUX.1. On FLUX.2 it saves nothing, and Z-Image has no 4-bit path. MiniMax H3 is always 4-bit.

## Stop and resume

Stopping a run writes a checkpoint first, so **Resume** continues from the same step. A checkpoint holds the adapter weights, optimizer state, RNG state and step number. Runs cut short by a crash or a server restart show up under **Outputs**, ready to resume.

Changing a setting in **Adjust** stages it behind an **Update** button. A checkpoint is tied to the rank, LoRA targets and base it was built with, so applying a change to a node with a resumable run asks first, then discards that run's checkpoints. Finished LoRA files are never touched.

## A worked example

[`inlineresearch/skin-lora-krea-2-raw`](https://huggingface.co/inlineresearch/skin-lora-krea-2-raw) is a skin-texture LoRA trained in Omnichar Studio on Krea 2 RAW, from the 26 image and caption pairs published as [`inlineresearch/krea2-skin-lora`](https://huggingface.co/datasets/inlineresearch/krea2-skin-lora).

| Setting | Value |
| - | - |
| Base | Krea 2 RAW, generated on Krea 2 Turbo |
| Rank / alpha | 16 / 16, full scope |
| Steps / batch | 1500 / 1 |
| Learning rate | 1e-4 |
| Resolution | 1024px |
| Caption dropout | 0.05, no flip |
| Checkpoint every | 250 steps |
| Trigger | `inline-skin-lora, detailed skin texture` |
| Generation | Krea 2 Turbo, 28 steps, guidance 4.5 |

The full benchmark matrix is in [TRAINING.md](https://github.com/omnichar/OmniChar/blob/main/TRAINING.md#benchmark-results).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.