> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/basics/fine-tune-diffusion-models-with-lora.md). Agents can also search and read this documentation through its [MCP server](https://unsloth.ai/docs/~gitbook/mcp).

# Fine-tuning Diffusion Image Models with LoRA locally

Train an image LoRA on your own pictures in Unsloth, with examples for FLUX.3, Qwen-Image-2.1, MiniMax-H3-Image and MOSS-Image.

A LoRA is a small add-on that teaches an image model a new style or subject. In Unsloth you train one from 10 to 50 of your own images, without writing code, then use it in **Create**. Each example below shows the same prompt and seed without (left) and with (right) a LoRA trained in Unsloth.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FWcXrlSDBcGYYD6BVE7Uj%2Fflux-3-image-klein-lora-before-after.webp?alt=media" alt="A photo-style cat on a throne without the LoRA, and a tarot card cat with the LoRA"><figcaption><p>FLUX.3 Image Klein, 500 steps on 60 tarot cards</p></figcaption></figure>

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FijqezpAgw4VOGal5hIaz%2Fmoss-image-train-int8-off.webp?alt=media" alt="A photo-style cat on a sofa in a dim living room"><figcaption><p>MOSS-Image without the LoRA</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FH1dHlRn6XjiAj0C1acN6%2Fmoss-image-train-int8-lora.webp?alt=media" alt="A neon line-art cat on a pink sofa with yellow and cyan outlines"><figcaption><p>With a LoRA trained on 16 neon line-art images</p></figcaption></figure></div>

## Which models you can train

| Model                                         | Train on                 | Use the LoRA on               | GPU memory (NVIDIA) | Default steps, rank, learning rate, resolution |
| --------------------------------------------- | ------------------------ | ----------------------------- | ------------------- | ---------------------------------------------- |
| [FLUX.3 Image Klein](#flux.3-image-klein)     | FLUX.3 Klein Base        | Klein and Klein Base          | 12 GB+ (nf4)        | 500, 32, 0.0001, 768                           |
| [Qwen-Image-2.1](#qwen-image-2.1)             | Qwen-Image-2.1           | Qwen-Image-2.1 and Turbo      | about 20 GB         | 500, 16, 0.0001, 768                           |
| [Qwen-Image-2.1-Turbo](#qwen-image-2.1-turbo) | Qwen-Image-2.1           | Turbo                         | about 20 GB         | 500, 16, 0.0001, 768                           |
| [MiniMax-H3-Image](#minimax-h3-image)         | MiniMax-H3-Image         | MiniMax-H3-Image (full model) | 32 GB+ (estimate)   | 150, 32, 0.00005, 1024                         |
| [MOSS-Image](#moss-image)                     | MOSS-Image-SFT (or Base) | MOSS-Image INT8, FP8 or bf16  | about 18 GB         | 500, 32, 0.0001, 768                           |

Distilled models (Klein, Qwen-Image-2.1-Turbo) are not training bases: train on their base model and run the LoRA on the distilled one. For video models, see [Fine-tune LTX-2.5](https://unsloth.ai/docs/models/ltx-2.5/fine-tune-ltx-2.5.md) and [Fine-tune MiniMax-H3](https://unsloth.ai/docs/models/minimax-h3/fine-tune-minimax-h3.md).

## How to train an image LoRA

{% hint style="info" %}
Image LoRA training needs Unsloth 2026.11.5 or newer (MOSS-Image: a release newer than 2026.11.6). Launch with `unsloth studio -H 0.0.0.0 -p 8888`.
{% endhint %}

**You need:**

* A supported GPU. Memory depends on the model; see the table above. AMD training is supported with bf16 and nf4 bases. MOSS-Image needs an NVIDIA GPU with bf16 (Ampere or newer).
* **10 to 50 images** of one style or subject.
* A **trigger word** in every caption, such as `trtcrd` or `sks neon style`, to turn the LoRA on in prompts.

{% stepper %}
{% step %}

#### Prepare your images

* **Formats:** PNG, JPG, WebP or BMP.
* **Captions:** a `.txt` (or `.caption`) file with the same name next to each image, for example `card1.png` and `card1.txt`. You can instead put a `metadata.jsonl` in the folder with one line per image, such as `{"file_name": "card1.png", "text": "a trtcrd of a queen holding a cup"}`. A caption file wins over `metadata.jsonl`.
* **Trigger word:** start every caption with it. Images without a caption use the **Trigger prompt**; with no trigger prompt they are skipped.
* Keep the set to one style or one subject. 16 images were enough for the neon examples below.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FRFx7SkEPPTTAmYluYzsQ%2Fmoss-image-train-data.webp?alt=media" alt="One neon line-art training image with yellow, pink and cyan shapes on dark stripes" width="192"><figcaption><p>One of 16 training images, caption ending in "sks neon style"</p></figcaption></figure>
{% endstep %}

{% step %}

#### Open Train and pick the model

In **Images**, click **Train** and set **Model family**. Pick the training base from the table above, for example **FLUX.3 Klein Base** for Klein or **Qwen-Image-2.1** for Turbo.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FkrF2GqAVUYrIcGW6Hmp8%2Fflux-3-image-klein-train-setup-lossless.png?alt=media" alt="Train panel with FLUX.3 Klein Base and the tarot dataset"><figcaption><p>Train setup with the 1920 Tarot example dataset</p></figcaption></figure>
{% endstep %}

{% step %}

#### Add your images

Under **Training images**, pick **Upload new images...** and upload the images with their captions, or start from an example dataset such as **1920 Tarot** (60 cards, captions start with `a trtcrd of`). Set an **Adapter name**: the LoRA's name in Create.
{% endstep %}

{% step %}

#### Check the settings

The defaults per model are in the table above. All models use a constant schedule with **20 warmup steps**. Set **Sample every** (for example `100`) and a **Sample prompt** with your trigger word to see preview images while it trains.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FYIsGg0LbE9chfPfamB9t%2Fqwen-image-2.1-train-settings-lossless.png?alt=media" alt="Train settings: 500 steps, rank 16, resolution 768, learning rate 0.0001, constant with warmup, 20 warmup steps, base precision Auto" width="560"><figcaption><p>Default settings for Qwen-Image-2.1</p></figcaption></figure>

**Base precision** is the precision of the frozen base model:

* **Auto** (recommended): on NVIDIA it picks bf16, then int8, then nf4 by free GPU memory.
* **nf4** uses the least memory. Use it on NVIDIA GPUs with 20 to 24 GB for Qwen-Image-2.1.
* On AMD, use bf16, nf4 or Auto; int8 and fp8 training bases are not supported.
  {% endstep %}

{% step %}

#### Start training

Click **Start training**. The loss is noisy; watch the smoothed line. Click a step number to compare the sample images.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FjTDqaYa2PtvPk6kFE7wF%2Fflux-3-image-klein-train-running-lossless.png?alt=media" alt="Training progress and loss chart"><figcaption><p>FLUX.3 Klein Base, bf16: 3.68 images/s, 13.1 GB peak</p></figcaption></figure>

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FCEvGPEue7Y9xpY3WpetL%2Fmoss-image-train-samples.webp?alt=media" alt="Sample images at steps 0, 100 and 200: a photo of a cat turning into neon line art"><figcaption><p>MOSS-Image samples at steps 0, 100 and 200</p></figcaption></figure>
{% endstep %}

{% step %}

#### Use the LoRA

When **Adapter ready** appears, the LoRA is in the LoRA list. Click **Deploy to Create** to load a model with your LoRA, then prompt with your trigger word and click **Generate**.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FGNedHT52Kz696XhagUlp%2Fqwen-image-2.1-train-done-lossless.png?alt=media" alt="Adapter ready with Deploy to Create"><figcaption><p>A finished run</p></figcaption></figure>

To add it yourself, load the model in Create, click **Add LoRA** and pick your LoRA. FP8 and INT8 builds add LoRAs only when the model loads, so click **Reapply** after adding one. Lower the LoRA **Weight** below 1 for a lighter effect.
{% endstep %}
{% endstepper %}

## Examples by model

### FLUX.3 Image Klein

Train on **FLUX.3 Klein Base**; the LoRA runs on both Klein and Klein Base. We trained on **1920 Tarot** (60 cards, trigger `trtcrd`) with the defaults: 500 steps took a little over 2 minutes on an NVIDIA RTX PRO 6000.

| Base precision | Training speed | Training loop memory |
| -------------- | -------------: | -------------------: |
| nf4            |  2.07 images/s |               6.9 GB |
| int8           |  1.92 images/s |               9.5 GB |
| bf16           |  3.69 images/s |              13.1 GB |
| fp8            |  4.41 images/s |               8.6 GB |

Same prompt and seed on Klein, without (left) and with (right) the LoRA: `a trtcrd of a cat sitting on a throne holding a golden cup, "queen of cats"`.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FWcXrlSDBcGYYD6BVE7Uj%2Fflux-3-image-klein-lora-before-after.webp?alt=media" alt="A photo-style cat on a throne without the LoRA, and a tarot card cat with the LoRA"><figcaption><p>16 steps, seed 42</p></figcaption></figure>

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F9u4DxZWCW1FqLjhEm3uo%2Fflux-3-image-klein-lora-create.webp?alt=media" alt="Create with the tarot LoRA loaded on FLUX.3 Image Klein"><figcaption><p>FLUX.3 Image Klein with the LoRA in Create</p></figcaption></figure>

**Deploy to Create** loads Klein with your LoRA. If Klein Base loaded as FP8 or INT8, click **Reapply** after adding the LoRA. Full guide: [Fine-tune FLUX 3](https://unsloth.ai/docs/models/flux-3/fine-tune-flux-3.md).

### Qwen-Image-2.1

Train on **Qwen-Image-2.1** (base `Qwen/Qwen-Image-2.1`). Budget about 20 GB on NVIDIA: the training loop uses about 6.5 GB with nf4, but caption encoding peaks at about 17.6 GB. Our run used **1920 Tarot** with the defaults and took about 7 minutes (3.5 for the 500 steps).

| Base precision | Training speed | Training loop memory |
| -------------- | -------------: | -------------------: |
| nf4            |  1.48 images/s |               6.5 GB |
| int8           |  1.66 images/s |               9.9 GB |
| bf16           |  2.56 images/s |              16.0 GB |
| fp8            |  3.28 images/s |               9.1 GB |

Measured on an NVIDIA RTX PRO 6000. fp8 is experimental. nf4 runs of 200+ steps are compiled and faster (2.29 images/s).

Seed 42, 1024 × 1024, 25 steps, guidance 1; only the LoRA changes. Prompt: `a trtcrd of a cat sitting on a throne holding a golden cup, "queen of cats"`

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FdtpLRpBNXOPRvAax5sdq%2Fqwen-image-2.1-lora-before.webp?alt=media" alt="Cat on a throne, photo"><figcaption><p>Without the LoRA</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FtZdkXWz83uKKjMSOVPfR%2Fqwen-image-2.1-lora-after.webp?alt=media" alt="Cat on a throne, tarot card"><figcaption><p>With the LoRA (500 steps, nf4)</p></figcaption></figure></div>

Use a square image near 1024 × 1024; a tall 832 × 1248 image showed little of the style. Full guide: [Fine-tune Qwen-Image-2.1](https://unsloth.ai/docs/models/qwen-image-2.1/fine-tune-qwen-image-2.1.md).

### Qwen-Image-2.1-Turbo

Turbo is distilled, so train on **Qwen-Image-2.1** and run the LoRA on Turbo. **Deploy to Create** after training loads Turbo with your LoRA; or load Turbo, click **Add LoRA**, pick your LoRA and click **Reapply**.

Seed 42, 1024 × 1024, 8 steps, guidance 1, INT8; only the LoRA changes (500 steps on 1920 Tarot). Prompt: `a trtcrd of a cat sitting on a throne holding a golden cup, "queen of cats"`

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FwAgkIclKaEbM0qwfQCDh%2Fqwen-image-2.1-turbo-lora-before.webp?alt=media" alt="Cat on a throne, photo"><figcaption><p>Without the LoRA</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F6Tip80jfAwmIUafJxo1t%2Fqwen-image-2.1-turbo-lora-after.webp?alt=media" alt="Cat on a throne, tarot card"><figcaption><p>With the LoRA</p></figcaption></figure></div>

Full guide: [Fine-tune Qwen-Image-2.1-Turbo](https://unsloth.ai/docs/models/qwen-image-2.1/qwen-image-2.1-turbo/fine-tune-qwen-image-2.1-turbo.md).

### MiniMax-H3-Image

Train on **MiniMax-H3-Image**. Plan for 32 GB+ of GPU memory (an estimate; tested on 96 GB) and about 95 GB of disk. **Auto** uses a bf16 base with 56 GB+ free (45.5 GB peak), else int8 (about 24 GB peak). The defaults are 150 steps at 1024 px and learning rate 0.00005; more steps can overcook the style and garble text. 150 steps on 1920 Tarot took about 100 seconds on an RTX PRO 6000 (about 8 minutes including the first download and load).

Seed 42, 1024 × 1024, enhancer off: `a trtcrd of a cat sitting on a throne holding a golden cup, "queen of cats"` and `a trtcrd of an astronaut standing on the moon holding a lantern, "the explorer"`.

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fkg53StPeOhBWosYeBEkn%2Fminimax-h3-image-lora-cat-before.webp?alt=media" alt="Without the LoRA: photo-like cat on a throne"><figcaption><p>No LoRA</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F5idj4QIy1DMxo4QWxs88%2Fminimax-h3-image-lora-cat-w06.webp?alt=media" alt="LoRA weight 0.6: illustrated cat"><figcaption><p>Weight 0.6</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FoD4Irr8nLFeWdVOvHUMT%2Fminimax-h3-image-lora-cat-after.webp?alt=media" alt="LoRA weight 1.0: tarot card style cat"><figcaption><p>Weight 1.0</p></figcaption></figure></div>

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FjEaC0aZLy24V1JEzLzdH%2Fminimax-h3-image-lora-astronaut-before.webp?alt=media" alt="Without the LoRA: astronaut photo"><figcaption><p>No LoRA</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F7KTnboVty4ipiJY5X4OH%2Fminimax-h3-image-lora-astronaut-after.webp?alt=media" alt="LoRA weight 1.0: tarot card style astronaut"><figcaption><p>Weight 1.0</p></figcaption></figure></div>

**Deploy to Create** loads the full 66 GB model (not the FP8 repo) with the LoRA merged in; changing the LoRA or its **Weight** needs a reload. The style is strongest at 1024 × 1024, the training size. Full guide: [Fine-tune MiniMax-H3-Image](https://unsloth.ai/docs/models/minimax-h3-image/fine-tune-minimax-h3-image.md).

### MOSS-Image

Train on **OpenMOSS-Team/MOSS-Image-SFT** (the default) or **MOSS-Image-Base**. It needs an NVIDIA GPU with bf16 (not a T4); Unsloth suggests about 18 GB. Our nf4 run's training loop used 4.6 GB, and the whole run peaked at 16.5 GB while the Qwen3.5-9B text encoder encoded the captions. Resolution must be a multiple of 16.

Our run: 16 neon line-art images, nf4 base, rank 32, learning rate 0.0002, 512 px, 200 steps. It trained at 5.5 images/s on an NVIDIA RTX PRO 6000 (Colab G4) and took about 3.3 minutes including loading and previews.

Seed 7, 512 × 512, 25 steps, guidance 2.5; only the LoRA changes. Prompt: `a cat sitting on a sofa in a cozy living room, sks neon style`

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FijqezpAgw4VOGal5hIaz%2Fmoss-image-train-int8-off.webp?alt=media" alt="A photo-style cat on a sofa in a dim living room"><figcaption><p>INT8, without the LoRA</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FH1dHlRn6XjiAj0C1acN6%2Fmoss-image-train-int8-lora.webp?alt=media" alt="A neon line-art cat on a pink sofa"><figcaption><p>INT8, LoRA added at load</p></figcaption></figure></div>

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F7rsuIK6p04myIaywl1sg%2Fmoss-image-train-bf16-off.webp?alt=media" alt="A photo-style cat on a sofa in a dim living room"><figcaption><p>bf16 (Speed Eager), without the LoRA</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FkPJyGGCLCXTXtrLIud9c%2Fmoss-image-train-bf16-lora.webp?alt=media" alt="A neon line-art cat on a pink sofa"><figcaption><p>bf16 (Speed Eager), LoRA weight 1</p></figcaption></figure></div>

On the INT8 or FP8 build, click **Add LoRA**, pick your LoRA, then **Reapply**. On bf16, set **Advanced → Speed** to **Eager** or **Off (bit-exact)** before loading; with **Speed** on **Auto**, MOSS-Image compiles from the first image and LoRAs are turned off. Full guide: [Fine-tune MOSS-Image](https://unsloth.ai/docs/models/moss-image/fine-tune-moss-image.md).

## Tips

* **Use the trigger word** in your prompts. Prompts without it change much less.
* **Weight:** 1.0 gives the full style; 0.6 to 0.8 is subtler.
* **Image size:** the style is strongest near the training resolution and a square canvas.
* **Too strong or garbled text:** train fewer steps or lower the weight.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/basics/fine-tune-diffusion-models-with-lora.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
