> 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/diffusion-image.md).

# How to Run Image Diffusion Models Locally with Unsloth

Generate and edit AI images locally without writing code. Unsloth supports [FLUX.3 Image Klein](https://unsloth.ai/docs/models/flux-3.md), [MiniMax-H3-Image](https://unsloth.ai/docs/models/minimax-h3-image.md), [Qwen-Image-2.1](https://unsloth.ai/docs/models/qwen-image-2.1.md) and [Qwen-Image-2.1-Turbo](https://unsloth.ai/docs/models/qwen-image-2.1/qwen-image-2.1-turbo.md), alongside Z-Image, FLUX.1 and SDXL. Start from a prompt or image, then use the generation, editing, reference-image and LoRA workflows available for that model.

### Image examples

Real outputs from the guides below, grouped by image model. Open a model guide for its prompts, settings and hardware notes; these are examples, not a controlled quality comparison.

#### FLUX.3 Image Klein

[Run and fine-tune FLUX.3 Image Klein →](https://unsloth.ai/docs/models/flux-3.md)

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FAUr9I8myeHeT9jCPPdV3%2Fflux-3-image-klein-out-bison.webp?alt=media" alt="A bison in a misty geothermal landscape at dawn"><figcaption><p>GGUF UD-Q4_K_XL</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fv7aDDYG13wwm4n2gTUCX%2Fflux-3-image-klein-out-cafe.webp?alt=media" alt="A chalkboard sign that reads Unsloth Coffee outside a cafe"><figcaption><p>FP8 repo, bf16</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FpqnjARNGI1y6IQ7dB6k5%2Fflux-3-image-klein-out-robot.webp?alt=media" alt="A small knitted robot next to a houseplant on a windowsill"><figcaption><p>FP8 repo, INT8</p></figcaption></figure></div>

#### MiniMax-H3-Image

[Run and fine-tune MiniMax-H3-Image →](https://unsloth.ai/docs/models/minimax-h3-image.md)

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FdhaLehHOWudDk9TmHJfW%2Fminimax-h3-image-out-valley.webp?alt=media" alt="Misty autumn valley with a wooden footbridge"><figcaption><p>FP8 repo (INT8)</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FE5iZZZi5oMaVw4Jo3ViS%2Fminimax-h3-image-out-island.webp?alt=media" alt="Isometric floating island city"><figcaption><p>FP8 repo (INT8)</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FQ8V3wLPL9YacqR4YD5LK%2Fminimax-h3-image-out-ramen.webp?alt=media" alt="Overhead photo of ramen"><figcaption><p>GGUF UD-Q4_K_XL</p></figcaption></figure></div>

#### Qwen-Image-2.1

[Run and fine-tune Qwen-Image-2.1 →](https://unsloth.ai/docs/models/qwen-image-2.1.md)

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F4aoR0eG610P5o96qSn3O%2Fqwen-image-2.1-out-cafe.webp?alt=media" alt="Barista pouring latte art"><figcaption><p>"A barista pouring latte art in a sunny minimalist cafe, morning light, editorial photo"</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FxjemXJe6MtuxE57IK3bK%2Fqwen-image-2.1-out-astronaut.webp?alt=media" alt="Astronaut on a frozen lake"><figcaption><p>"A lone astronaut crossing a frozen lake under a huge ringed planet, blue twilight, cinematic"</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FpVRGxtjLmheo2ahNAmnd%2Fqwen-image-2.1-out-market.webp?alt=media" alt="Watercolor flower market by a canal"><figcaption><p>"A watercolor painting of a flower market along a canal in Amsterdam, soft spring colors"</p></figcaption></figure></div>

#### Qwen-Image-2.1-Turbo

[Run Qwen-Image-2.1-Turbo →](https://unsloth.ai/docs/models/qwen-image-2.1/qwen-image-2.1-turbo.md)

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fa5teZGDbqQn7KJGSDa3P%2Fqwen-image-2.1-turbo-out-ramen.webp?alt=media" alt="Neon ramen shop"><figcaption><p>"A neon-lit ramen shop in a rainy Tokyo alley at night, reflections on wet pavement, cinematic photo" (Q4_K_M, 13 s)</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FeUgMrARGjaBd9HfVYBNW%2Fqwen-image-2.1-turbo-out-bee.webp?alt=media" alt="Honeybee on a sunflower"><figcaption><p>"Macro photograph of a honeybee on a sunflower, visible pollen grains, extreme detail" (Q4_K_M, 13 s)</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FOoLevkElFI5ptCbyzKsM%2Fqwen-image-2.1-turbo-out-island.webp?alt=media" alt="Isometric lighthouse island"><figcaption><p>"Isometric 3D illustration of a tiny island with a lighthouse, pastel colors, soft shadows" (FP8 repo, 7 s)</p></figcaption></figure></div>

Looking for video? [MiniMax-H3](https://unsloth.ai/docs/models/minimax-h3.md) is a separate video-and-audio model, not MiniMax-H3-Image. Use the Video page and its dedicated guide. LTX is also a video model.

To create an image LoRA, train a supported base: [FLUX.3 Klein Base](https://unsloth.ai/docs/models/flux-3.md#train-a-lora), [Qwen-Image-2.1](https://unsloth.ai/docs/models/qwen-image-2.1.md#train-a-lora) or [MiniMax-H3-Image](https://unsloth.ai/docs/models/minimax-h3-image.md#train-a-lora). Qwen-Image-2.1 LoRAs run on Turbo; Turbo itself is not a training base.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FGg2Q8Jd4doV8TVHuEbdL%2Fflux-3-image-klein-flow.webp?alt=media" alt="Animation: pick FLUX.3 Image Klein (Fast FP8), type a prompt, click Generate and get a lighthouse on a cliff"><figcaption><p>FLUX.3 Image Klein: choose a model, enter a prompt and generate. Sped-up demonstration.</p></figcaption></figure>

### ⚡ Quickstart

{% stepper %}
{% step %}

### **Install or update**

The desktop app is the easiest way to get started.

<a href="https://unsloth.ai/download" class="button primary" data-icon="down-to-bracket">Download Unsloth Desktop</a>

Follow the installer, then open the app from your applications. If you already have it installed, make sure it is up to date before continuing.

**Command line**

Prefer the terminal? Run the command for your operating system. The same command will update an existing installation.

**MacOS, Linux, WSL:**

```bash
curl -fsSL https://unsloth.ai/install.sh | sh
```

**Windows PowerShell:**

```powershell
irm https://unsloth.ai/install.ps1 | iex
```

#### Launch Unsloth

Once the installation finishes, launch Unsloth:

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

Open `http://localhost:8888` if it does not open automatically.
{% endstep %}

{% step %}

### Open Images

Select **Images** from the sidebar. The **Create** workflow opens by default.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F8VA0qli15m452CIo2DeL%2Fflux-3-image-klein-images-page.png?alt=media" alt="The Unsloth Images page with the Create workflow open and no model loaded"><figcaption><p>Images → Create, before loading a model.</p></figcaption></figure>

Now we are ready to move onto the next step.
{% endstep %}

{% step %}

### Choose a model

Open Select image model and search for FLUX.3 Image Klein, MiniMax-H3-Image, Qwen-Image-2.1 or Qwen-Image-2.1-Turbo. Klein is a smaller general-purpose choice; Turbo uses eight steps. Check the model guide for hardware and memory requirements.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F7ld8GwJlyKwIf9n0WXy2%2Fflux-3-image-klein-picker-search.png?alt=media" alt="Model picker search results for flux-3-image-klein with the Fast FP8, GGUF and Base entries"><figcaption><p>FLUX.3 search: Klein for generation and editing, Klein Base for LoRA training.</p></figcaption></figure>

The **Recommended** tab is a good place to start.\
\
For GGUF models, the best size for your device is also marked **recommended**. Sizes that may run slowly or not fit are marked **TIGHT** or **OOM**.
{% endstep %}

{% step %}

### Enter a prompt

Describe the image you want to generate.

For example:

> A lighthouse on a coastal cliff at golden hour

Keep the loaded model's defaults: Klein uses 16 steps and guidance 1; Qwen-Image-2.1 uses 25 steps and guidance 1; Turbo uses 8 steps and guidance 1; MiniMax-H3-Image uses 6 steps without CFG. These settings are not interchangeable. Klein and MiniMax-H3-Image also offer a separately downloaded prompt enhancer.
{% endstep %}

{% step %}

### Generate your first image

Select **Generate**. The first generation may take longer while the model downloads and loads.

Your result will appear in the gallery, where you can view its settings or download it.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FYBY7Z8KuulG11IHwzyEa%2Fflux-3-image-klein-result.png?alt=media" alt="Finished image of a lighthouse on a rocky coast at sunset, with the enhanced prompt on the left"><figcaption><p>FLUX.3 Image Klein result with the lighthouse prompt and prompt enhancer.</p></figcaption></figure>
{% endstep %}
{% endstepper %}

### ⭐ Features

The available workflows depend on the model you load. Unsupported workflows are hidden automatically.

#### Create and edit images

* **Create:** Generate an image from a text prompt.
* **Transform:** Use an existing image as the starting point for a new generation.
* **Inpaint:** Select and regenerate part of an image.
* **Extend:** Generate content beyond the original canvas.
* **Upscale:** Increase the resolution of an image.
* **Reference:** Guide a generation with one or more reference images.
* **Edit:** Describe the changes you want to make to an image.

Instruction-based Edit is supported by [FLUX.3 Image Klein](https://unsloth.ai/docs/models/flux-3.md#image-editing), [MiniMax-H3-Image](https://unsloth.ai/docs/models/minimax-h3-image.md#image-editing), [Qwen-Image-2.1](https://unsloth.ai/docs/models/qwen-image-2.1.md#image-editing) and [Turbo](https://unsloth.ai/docs/models/qwen-image-2.1/qwen-image-2.1-turbo.md#image-editing), as well as Qwen-Image-Edit and FLUX.1 Kontext. Follow the model guide for reference-image limits and output sizes.

#### LoRAs and ControlNet

Load compatible LoRAs to add a character, subject or visual style to your generations. Adjust the LoRA weight to control how strongly it affects the result.

Supported models can also use ControlNet to guide the structure of an image. Adjust its strength to control how closely the result follows the guidance image.

#### Gallery

Generated images are saved to the local gallery. Open a result to view its prompt and settings, select **Recipe** to restore its generation setup or download the image.

### Supported models and workflows

| Model                | Workflow and detailed guide                                                                                                                                                                         |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FLUX.3 Image Klein   | [FLUX.3 guide](https://unsloth.ai/docs/models/flux-3.md): create and edit; 16 steps, guidance 1. Train LoRAs on Klein Base.                                                                         |
| MiniMax-H3-Image     | [MiniMax-H3-Image guide](https://unsloth.ai/docs/models/minimax-h3-image.md): create and edit, up to 16 references; 6 steps, no CFG, 2048 × 2048 canvas. Check its large-model memory requirements. |
| Qwen-Image-2.1       | [Qwen-Image-2.1 guide](https://unsloth.ai/docs/models/qwen-image-2.1.md): create and edit, native 2K and up to 10 references; 25 steps, guidance 1. Use this base for Qwen image LoRA training.     |
| Qwen-Image-2.1-Turbo | [Turbo guide](https://unsloth.ai/docs/models/qwen-image-2.1/qwen-image-2.1-turbo.md): create and edit in 8 steps, guidance 1. Same memory needs as the base, not a smaller model.                   |
| Other image families | Z-Image, FLUX.1, FLUX.2 klein and SDXL remain available. Transform, inpaint, extend, upscale and ControlNet depend on the model.                                                                    |

Fast FP8 names a picker entry, not a guarantee that every component runs in FP8. Auto can select another supported precision; Qwen and MiniMax-H3-Image commonly load INT8-ConvRot. GGUF is another route, including Mac and CPU use where supported. Check each guide's tested configurations rather than treating file size or memory estimates as guaranteed minimum requirements.

#### Current image workflows

These screenshots come from the model-specific guides; the models do not share interchangeable settings.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FJDkNG5C6ikli5XD6lIpx%2Fminimax-h3-image-result.png?alt=media" alt="Ginger cat asleep on books in a rainy bookshop window"><figcaption><p>MiniMax-H3-Image generation and gallery. See its guide for memory requirements.</p></figcaption></figure>

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FE4WmS2aVmN1x1uB7Vsi4%2Fqwen-image-2.1-edit.png?alt=media" alt="Edit at 2048 with result"><figcaption><p>Qwen-Image-2.1 instruction-based Edit at 2048 resolution.</p></figcaption></figure>

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FStfTvPOPpHeJYXq5d81R%2Fqwen-image-2.1-turbo-result.png?alt=media" alt="Finished boathouse image and gallery"><figcaption><p>Qwen-Image-2.1-Turbo generation and gallery, using its eight-step schedule.</p></figcaption></figure>

#### Video is a separate workflow

[MiniMax-H3 video guide](https://unsloth.ai/docs/models/minimax-h3.md) covers video with sound and video LoRA training. Open the Video page rather than selecting MiniMax-H3 in the image model picker.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FqCq3GkDxVruGcu5LGHPi%2Fminimax-h3-video-page.png?alt=media" alt="The Unsloth Video page with the Create tab open and no model loaded"><figcaption><p>MiniMax-H3 uses the separate Video page, not the Images workflow.</p></figcaption></figure>

### Generation settings

The default settings are a good starting point. However, it is possible to adjust settings to get the best result, these are the main parameters you may want to change:

| Setting                         | What it changes                                                                              |
| ------------------------------- | -------------------------------------------------------------------------------------------- |
| **Prompt**                      | Describes the image you want to create. In **Edit**, this becomes the instruction to follow. |
| **Aspect ratio and resolution** | Set the shape and size of the image. Larger images use more memory and take longer.          |
| **Steps**                       | Control how long the model spends generating. More steps do not always improve the result.   |
| **Guidance**                    | Controls how strongly the prompt guides the result. Some models work best at `0`.            |
| **Seed**                        | Helps recreate a result. Leave it empty to use a random seed.                                |

<details>

<summary>Advanced generation settings</summary>

These controls change how the model runs on your device. Adjust them to reduce memory usage, improve performance or troubleshoot generation.

| Setting         | What it changes                                                                                                                                  |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Speed**       | Controls compilation and performance optimizations. Compiled modes may take longer during the first generation.                                  |
| **Precision**   | Changes the numerical format used to run the model. Lower precision can reduce memory usage. Available options depend on the model and hardware. |
| **Attention**   | Selects the attention implementation used during generation.                                                                                     |
| **Memory**      | Balances generation speed against GPU memory usage. Try **Low VRAM** if a model is close to your memory limit.                                   |
| **Step cache**  | Reuses some calculations between diffusion steps to improve generation speed.                                                                    |
| **CPU offload** | Moves parts of the model into system memory. This reduces GPU memory usage but may make generation slower.                                       |

</details>

### ⚠️ Troubleshooting

<details>

<summary>Images does not appear</summary>

Update to the latest version, then restart the app. See [Updating Unsloth](https://unsloth.ai/docs/get-started/install/updating) for instructions.

</details>

<details>

<summary>A model will not download or load</summary>

Some image models are large and take time to download. Check that you have enough free storage and a stable internet connection.

Some models also require you to accept their licence on Hugging Face and add a Hugging Face token before downloading them.

</details>

<details>

<summary>The model runs out of memory</summary>

Try a smaller GGUF quantization or a 4-bit version of the model. For GGUF models, start with the size marked **recommended**.

You can also:

* Lower the image resolution.
* Keep the batch size at `1`.
* Close other applications using the GPU.
* Choose a smaller model.

A **TIGHT** model may use system memory and run more slowly. A model marked **OOM** is unlikely to fit.

</details>

<details>

<summary>A workflow is missing</summary>

The available workflows depend on the loaded model. Unsupported workflows will not appear.

For instruction-based editing, load FLUX.3 Image Klein, MiniMax-H3-Image, Qwen-Image-2.1 or Turbo, then select Edit. Other workflows still depend on the model.

</details>

### ❓ FAQ

<details>

<summary>Does image generation run locally?</summary>

Yes. Once a model is downloaded, image generation runs on your device.

</details>

<details>

<summary>What is the difference between Transform and Edit?</summary>

**Transform** redraws an existing image using a prompt that describes the complete result.

**Edit** follows instructions such as changing a background or adding an object. It requires a compatible editing model.

</details>

<details>

<summary>Can I train my own image LoRA?</summary>

Yes. Fine-tune a supported model on your own images, then load the finished LoRA in **Create**.

See [FLUX.3 Klein Base training](https://unsloth.ai/docs/models/flux-3.md#train-a-lora), [Qwen-Image-2.1 training](https://unsloth.ai/docs/models/qwen-image-2.1.md#train-a-lora) or [MiniMax-H3-Image training](https://unsloth.ai/docs/models/minimax-h3-image.md#train-a-lora) for hardware, datasets and deployment. Supported NVIDIA and AMD configurations vary by family.

</details>


---

# 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/diffusion-image.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.
