> 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/models/flux-3.md).

# FLUX 3 Image - How to run locally

Run and fine-tune FLUX.3 Image Klein locally with Unsloth FP8 and GGUF quants, prompt enhancement, image editing and LoRA training.

**FLUX.3 Image Klein** is Black Forest Labs' 5.6B text-to-image and image editing model, with a Qwen3-VL-4B text encoder and **16 steps**. A 1024 × 1024 image takes about **3 to 5 seconds** in Unsloth on a 40 GB A100.

{% columns %}
{% column width="50%" %}
Klein likes long, detailed prompts; the **prompt enhancer** writes them from a short idea.

The quants use [Unsloth Dynamic](https://unsloth.ai/docs/basics/dynamic-3.0-ggufs), which keeps important layers in higher precision. Run them in [Unsloth](https://unsloth.ai/docs/desktop.md), stable-diffusion.cpp and more.

* FLUX.3 Image Klein: [GGUF](https://huggingface.co/unsloth/flux-3-image-klein-GGUF) • [FP8](https://huggingface.co/unsloth/flux-3-image-klein-FP8)
* FLUX.3 Image Klein Base: [GGUF](https://huggingface.co/unsloth/flux-3-image-klein-base-GGUF) • [FP8](https://huggingface.co/unsloth/flux-3-image-klein-base-FP8)
* Prompt enhancer: [GGUF](https://huggingface.co/unsloth/flux-3-image-klein-pup-GGUF)

Tested with Unsloth 2026.11.4 on an NVIDIA A100 (40 GB).
{% endcolumn %}

{% column width="50%" %}

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FQTjIpy3wMaxquGwfFjXu%2Fflux-3-image-klein-out-lighthouse-enhanced.webp?alt=media" alt="Photo of a white lighthouse with a lit lamp and a keeper&#x27;s cottage on a rocky coast at sunset"><figcaption><p>UD-Q4_K_XL, enhancer on. Prompt: "A lighthouse on a coastal cliff at golden hour"</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

<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>

### Klein or Klein Base? <a href="#klein-or-klein-base" id="klein-or-klein-base"></a>

| Model                       | Steps and guidance     | Use it for                                  |
| --------------------------- | ---------------------- | ------------------------------------------- |
| **FLUX.3 Image Klein**      | 16 steps, guidance 1   | Making and editing images. **Start here.**  |
| **FLUX.3 Image Klein Base** | 50 steps, guidance 3.5 | [LoRA training](#train-a-lora) and research |

Klein is distilled from Base; Unsloth sets steps and guidance for both. Only Klein was tested here.

### Memory requirements <a href="#memory-requirements" id="memory-requirements"></a>

| Your hardware                   | Start with                                                                |
| ------------------------------- | ------------------------------------------------------------------------- |
| **GPU with 24 GB or more**      | **FLUX.3 Image Klein (Fast FP8)**. Unsloth picks the precision that fits. |
| **GPU with 12 to 16 GB**        | GGUF **UD-Q4\_K\_XL**. You may need to turn the enhancer off.             |
| **GPU with 8 GB or less**       | GGUF **UD-Q3\_K\_XL** or **UD-Q2\_K\_XL**, enhancer off                   |
| **Mac with 16 GB or more**      | GGUF **UD-Q4\_K\_XL**                                                     |
| **CPU only, 16 GB RAM or more** | GGUF **UD-Q4\_K\_XL** (slow)                                              |

Other rows are estimates. Measured on the 40 GB A100 (`nvidia-smi`, upper bounds):

| What was loaded                                         | GPU memory in use |
| ------------------------------------------------------- | ----------------- |
| GGUF UD-Q4\_K\_XL + INT8 text encoder, ready            | 9.3 GB            |
| The same, plus the prompt enhancer                      | about 17 GB       |
| The same, while generating                              | about 22 GB       |
| Fast FP8 entry (bf16 weights) + enhancer, while editing | about 27 GB       |

With stable-diffusion.cpp, UD-Q4\_K\_XL + Q8\_0 text encoder + VAE used **8.0 GB of VRAM** (L4).

#### FP8, INT8 and GGUF <a href="#fp8-int8-and-gguf" id="fp8-int8-and-gguf"></a>

* **FLUX.3 Image Klein (Fast FP8)** downloads the [FP8 repo](https://huggingface.co/unsloth/flux-3-image-klein-FP8) (about 17 GB), which holds bf16, FP8 and INT8 weights. With **Precision** on **Auto**, Unsloth picks what fits: on our 40 GB A100 it kept **bf16**. **INT8** loads the INT8-ConvRot file. The text encoder always ran as INT8-ConvRot. **FP8** needs a GPU with FP8 support (not tested).
* **flux-3-image-klein-GGUF (Slow)** downloads only the quant you pick and also runs on Macs and CPUs.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FyPEeQllb7XKpoHewivZV%2Fflux-3-image-klein-precision.png?alt=media" alt="The Advanced settings with the Precision menu open, showing Auto, Off, FP8, INT8 and MXFP8" width="352"><figcaption><p>Advanced → Precision (OFF = bf16)</p></figcaption></figure>

| GGUF file        | Size   | Notes           |
| ---------------- | ------ | --------------- |
| **BF16**         | 11 GB  | Full precision  |
| **Q8\_0**        | 6.1 GB | Closest to BF16 |
| **UD-Q5\_K\_XL** | 4.5 GB |                 |
| **UD-Q4\_K\_XL** | 3.9 GB | **Recommended** |
| **UD-Q3\_K\_XL** | 3.3 GB | For small GPUs  |
| **UD-Q2\_K\_XL** | 2.6 GB | Smallest        |

#### Hardware notes <a href="#hardware-notes" id="hardware-notes"></a>

These need Unsloth 2026.11.5 or newer.

* **T4 and other GPUs without bf16:** Klein and Klein Base run in fp16 with INT8 weights. On a 15 GB Colab T4 at 1024 x 1024:

  | Task                                | Time per image |
  | ----------------------------------- | -------------- |
  | Klein, text to image                | 34 to 38 s     |
  | Klein Base, text to image, 12 steps | about 54 s     |
  | Klein edit                          | about 96 s     |
  | Klein Base edit                     | about 130 s    |

  Edits peak at about 9.1 GB of GPU memory. The **Default** speed mode no longer runs slower than **Off** on these cards. LoRAs load and render. Training needs a bf16 GPU (Ampere or newer); on a T4, Unsloth refuses with "This trainer requires a bfloat16-capable GPU".
* **AMD on Linux** (Radeon 8060S, gfx1151): Klein Base LoRA training with **bf16** and **nf4** bases, reloading, rendering with the LoRA on Klein and export all work. The **int8**, **fp8** and **mxfp8** bases are NVIDIA only.
* **AMD on Windows** (gfx1151): LoRA training works; without a C++ compiler it trains without torch.compile and shows a warning. Renders at 512 px, which came out as noise in older builds, are now correct.

### Quickstart <a href="#quickstart" id="quickstart"></a>

<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>The Unsloth flow, sped up</p></figcaption></figure>

{% stepper %}
{% step %}

#### Install Unsloth <a href="#install-unsloth" id="install-unsloth"></a>

Get the [Unsloth Desktop app](https://unsloth.ai/docs/desktop.md) for [macOS](https://unsloth.ai/docs/get-started/install/mac.md), [Windows](https://unsloth.ai/docs/get-started/install/windows-installation.md) or [Linux](https://unsloth.ai/docs/get-started/install/linux.md).

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

Or from the terminal. MacOS, Linux, WSL:

{% code collapsedlinecount="10" %}

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

{% endcode %}

Windows PowerShell:

{% code collapsedlinecount="10" %}

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

{% endcode %}

Then launch Unsloth and open `http://localhost:8888`:

{% code collapsedlinecount="10" %}

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

{% endcode %}
{% endstep %}

{% step %}

#### Open Images <a href="#open-images" id="open-images"></a>

Select **Images** in the sidebar. **Create** 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>The Images page</p></figcaption></figure>
{% endstep %}

{% step %}

#### Pick FLUX.3 Image Klein <a href="#pick-flux.3-image-klein" id="pick-flux.3-image-klein"></a>

Click **Select image model**, search `flux-3-image-klein` and pick:

* **FLUX.3 Image Klein (Fast FP8)**: NVIDIA GPUs with 24 GB or more.
* **flux-3-image-klein-GGUF (Slow)**: pick a quant. **UD-Q4\_K\_XL** is recommended.

<div><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>Search results</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FuwZH1ghawU9coIRFFfQE%2Fflux-3-image-klein-gguf-quants.png?alt=media" alt="The GGUF entry expanded to show its quants, with UD-Q4_K_XL marked recommended"><figcaption><p>GGUF quants</p></figcaption></figure></div>

The first load downloads the model, Qwen3-VL-4B text encoder and VAE.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FpGtiaObZ9zOIVlRFb72x%2Fflux-3-image-klein-download.png?alt=media" alt="Download panel showing unsloth/flux-3-image-klein-FP8 at 16 of 17 GB" width="400"><figcaption><p>First download of the Fast FP8 entry</p></figcaption></figure>
{% endstep %}

{% step %}

#### Download the prompt enhancer <a href="#download-the-prompt-enhancer" id="download-the-prompt-enhancer"></a>

**Enhance prompt** is on by default, but the enhancer is a separate download. Click **Download (6.9 GB)**. Until then, prompts run as typed.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F3ImhyuNDB6ajCvlyIvHy%2Fflux-3-image-klein-enhance-download.png?alt=media" alt="Enhance prompt switch with the message that the 6.9 GB prompt upsampler is not downloaded and a Download button" width="400"><figcaption><p>Enhancer not downloaded yet</p></figcaption></figure>
{% endstep %}

{% step %}

#### Write your prompt and generate <a href="#write-your-prompt-and-generate" id="write-your-prompt-and-generate"></a>

Unsloth sets **16 steps** and **guidance 1**; keep them. Set a seed to repeat a result.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FMnY6sWJJfDmxiIVJ4xSq%2Fflux-3-image-klein-settings.png?alt=media" alt="Create panel with the lighthouse prompt, Enhance prompt on, 1024 by 1024 size, 16 steps and guidance 1" width="432"><figcaption><p>Klein defaults</p></figcaption></figure>

**Preview** shows the enhanced prompt; **Use as prompt** copies it into the box for editing.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FYYLjG5FX73Houj4AuVCE%2Fflux-3-image-klein-enhanced-prompt.png?alt=media" alt="The short lighthouse prompt and, below it, the long enhanced prompt written by the prompt enhancer" width="338"><figcaption><p>Enhanced prompt preview</p></figcaption></figure>

Click **Generate**. **Recipe** shows every setting, including the **Enhanced prompt**.

<div><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>UD-Q4_K_XL, 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%2F6pEui5DMl0ErLuhr9aPu%2Fflux-3-image-klein-recipe.png?alt=media" alt="Recipe card showing the prompt, the enhanced prompt, model, GGUF file, size, time, steps, guidance and seed" width="320"><figcaption><p>Recipe card</p></figcaption></figure></div>
{% endstep %}
{% endstepper %}

#### Prompt enhancer <a href="#prompt-enhancer" id="prompt-enhancer"></a>

The enhancer is [flux-3-image-klein-pup](https://huggingface.co/unsloth/flux-3-image-klein-pup-GGUF), a 9B model (UD-Q4\_K\_XL 6.0 GB + vision file 0.9 GB) that runs on your GPU next to Klein. It adds about **7.5 GB** of GPU memory and a few seconds per image; the first image with it took 23.5 s. Short of memory? Turn it off and write a long prompt: setting, subject, action, light and style.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FGY1Tu4gOxIg3INJktImx%2Fflux-3-image-klein-out-lighthouse-plain.webp?alt=media" alt="Simpler photo of a lighthouse at the end of a grassy cliff path at golden hour" width="400"><figcaption><p>Same prompt and seed, enhancer off (4.3 s)</p></figcaption></figure>

### Image editing <a href="#image-editing" id="image-editing"></a>

Select **Edit** in the sidebar, upload an image, write an instruction and click **Generate**. Keep 16 steps and guidance 1. **Add image** adds more references. With **Enhance prompt** on, the enhancer also reads your image. Short, concrete instructions work best.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FWnpm5byWe25kaz6AI8ad%2Fflux-3-image-klein-edit.png?alt=media" alt="Edit workflow with the lighthouse image as the source, the instruction to paint red and white stripes and add a sailboat, the enhanced edit prompt and the result"><figcaption><p>Fast FP8 entry (bf16): 8.9 s plus the enhancer</p></figcaption></figure>

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fbzd0jcFnSE1JWobeV6R4%2Fflux-3-image-klein-edit-before.webp?alt=media" alt="Original image of a white lighthouse on a grassy cliff at golden hour"><figcaption><p>Before</p></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FJHm0cjexC7FEH2RcY0g0%2Fflux-3-image-klein-edit-after.webp?alt=media" alt="Edited image where the lighthouse has red and white stripes and a small sailboat is on the sea"><figcaption><p>"Paint the lighthouse with red and white stripes and add a small sailboat on the sea"</p></figcaption></figure></div>

### Train a LoRA <a href="#train-a-lora" id="train-a-lora"></a>

See [Fine-tune FLUX 3](https://unsloth.ai/docs/models/flux-3/fine-tune-flux-3.md)

#### Before and after <a href="#before-and-after" id="before-and-after"></a>

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>

Prompts without the trigger word change much less. Stable-diffusion.cpp does not load FLUX.3 LoRAs yet.

[Continue in the fine-tuning guide](https://unsloth.ai/docs/models/flux-3/fine-tune-flux-3.md#before-and-after)

### Run from code <a href="#run-from-code" id="run-from-code"></a>

#### Unsloth API <a href="#unsloth-api" id="unsloth-api"></a>

Unsloth has an OpenAI-compatible `POST /v1/images/generations` endpoint. Load Klein on the Images page first: requests use the loaded model unless **Switch image and video model by request** is on in **Settings → API**. Create an API key there too (see [Unsloth API](https://unsloth.ai/docs/basics/api.md)); the examples read it from `UNSLOTH_API_KEY`.

<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FaVPPWWZ0eRFi4YI6Lgyb%2Fflux-3-image-klein-api-settings.png?alt=media" alt="Settings, API page with the Images and Video quickstart and the switch for loading models by request" width="563"><figcaption><p>Settings → API</p></figcaption></figure>

With `openai` (`pip install openai`):

{% code collapsedlinecount="10" %}

```python
import base64
import os

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8888/v1", api_key=os.environ["UNSLOTH_API_KEY"])

result = client.images.generate(
    model="unsloth/flux-3-image-klein-FP8",
    prompt="A lighthouse on a coastal cliff at golden hour",
    size="1024x1024",
    response_format="b64_json",
    extra_body={"steps": 16, "guidance": 1.0, "seed": 42},
)

with open("lighthouse.png", "wb") as f:
    f.write(base64.b64decode(result.data[0].b64_json))
```

{% endcode %}

With `curl`:

{% code collapsedlinecount="10" %}

```bash
curl -s http://localhost:8888/v1/images/generations \
  -H "Authorization: Bearer $UNSLOTH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "unsloth/flux-3-image-klein-FP8",
    "prompt": "A lighthouse on a coastal cliff at golden hour",
    "size": "1024x1024",
    "response_format": "b64_json",
    "seed": 7
  }' \
  | python3 -c "import sys, json, base64; open('lighthouse-curl.png', 'wb').write(base64.b64decode(json.load(sys.stdin)['data'][0]['b64_json']))"
```

{% endcode %}

`size` is `WIDTHxHEIGHT`, 256 to 2048, in multiples of 16. `steps` and `guidance` default to 16 and 1.

**LoRAs over the API** (Unsloth 2026.11.5 or newer): add `"loras": [{"id": "my-lora", "weight": 1.0}]` to the request, where `id` is the name in the LoRA list, or `"loras": []` for none. Without `loras`, FP8 and INT8 loads keep the LoRAs they were loaded with, for example after **Deploy to Create**.

FP8 and INT8 loads take LoRAs only when the model loads. A request on such a load can use the LoRAs it was loaded with, or some of them, but a LoRA it was not loaded with returns a 400 error. Load the model with that LoRA first: pick it on the Images page and click **Reapply**, or send it as `loras` when you load the model. A bf16 load (**Precision** set to **Off**) takes any LoRA per request.

{% hint style="info" %}
The API does not run the prompt enhancer. Send a detailed prompt, or write one with **Preview** on the Images page.
{% endhint %}

#### GGUF with stable-diffusion.cpp <a href="#gguf-with-stable-diffusion.cpp" id="gguf-with-stable-diffusion.cpp"></a>

Run the GGUF with `sd-cli` from [stable-diffusion.cpp](https://github.com/unslothai/stable-diffusion.cpp) (Unsloth's pinned release; no prompt enhancer).

**1. Get `sd-cli`** (Linux, CUDA 13). The [release page](https://github.com/unslothai/stable-diffusion.cpp/releases/tag/master-982-0518b34-u27b9ddc) also has CUDA 12, Vulkan, CPU, macOS and Windows builds.

{% code collapsedlinecount="10" %}

```bash
curl -L -o sd.zip https://github.com/unslothai/stable-diffusion.cpp/releases/download/master-982-0518b34-u27b9ddc/sd-master-982-0518b34-u27b9ddc-bin-Linux-Ubuntu-22.04-x86_64-cuda13.zip
unzip -o sd.zip
mv sd-master-982-0518b34-u27b9ddc-bin-Linux-Ubuntu-22.04-x86_64-cuda13 sd
./sd/sd-cli --version
```

{% endcode %}

**2. Download the model, text encoder and VAE** (about 8.5 GB):

{% code collapsedlinecount="10" %}

```bash
pip install -U huggingface_hub
hf download unsloth/flux-3-image-klein-GGUF flux-3-image-klein-UD-Q4_K_XL.gguf --local-dir models
hf download unsloth/Qwen3-VL-4B-Instruct-GGUF Qwen3-VL-4B-Instruct-Q8_0.gguf --local-dir models
hf download unsloth/flux-3-image-klein-FP8 vae/diffusion_pytorch_model.safetensors --local-dir models
```

{% endcode %}

**3. Create an image** (14 s on an A100, including loading):

{% code collapsedlinecount="10" %}

```bash
./sd/sd-cli \
  --diffusion-model models/flux-3-image-klein-UD-Q4_K_XL.gguf \
  --llm models/Qwen3-VL-4B-Instruct-Q8_0.gguf \
  --vae models/vae/diffusion_pytorch_model.safetensors \
  -p "A white lighthouse on a grassy coastal cliff at golden hour, waves breaking on the rocks below, warm low sunlight, soft clouds over the sea, detailed landscape photo" \
  --steps 16 --cfg-scale 1.0 --sampling-method euler \
  -W 1024 -H 1024 --diffusion-fa --seed 42 \
  -o lighthouse-sdcpp.png
```

{% endcode %}

**4. Edit an image** (24 s). Pass up to 10 references with `-r`. Describe the whole edited image, not only the change.

{% code collapsedlinecount="10" %}

```bash
./sd/sd-cli \
  --diffusion-model models/flux-3-image-klein-UD-Q4_K_XL.gguf \
  --llm models/Qwen3-VL-4B-Instruct-Q8_0.gguf \
  --vae models/vae/diffusion_pytorch_model.safetensors \
  -r lighthouse-sdcpp.png \
  -p "The same lighthouse on the same coastal cliff at golden hour, now painted with bold red and white horizontal stripes, with a small white sailboat on the sea" \
  --steps 16 --cfg-scale 1.0 --sampling-method euler \
  -W 1024 -H 1024 --diffusion-fa --seed 42 \
  -o lighthouse-sdcpp-edit.png
```

{% endcode %}

<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FvzWfsBB5NEx4aj1sJZxK%2Fflux-3-image-klein-sdcpp-lighthouse.webp?alt=media" alt="White lighthouse on a grassy cliff above breaking waves at golden hour, made with sd-cli"><figcaption><p>sd-cli, 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%2FcDFt1OjcIM85yHspkii0%2Fflux-3-image-klein-sdcpp-edit.webp?alt=media" alt="The same lighthouse painted with red and white stripes, with a small sailboat on the sea"><figcaption><p>sd-cli edit</p></figcaption></figure></div>

On a Mac or CPU, use a GGUF quant in the app, or the `Darwin-macOS-arm64` / CPU `sd-cli` builds (not tested by us).

### Recommended settings <a href="#recommended-settings" id="recommended-settings"></a>

| Setting             | Unsloth (FP8 or GGUF)            | stable-diffusion.cpp      |
| ------------------- | -------------------------------- | ------------------------- |
| **Steps**           | **16**                           | `--steps 16`              |
| **Guidance / CFG**  | **1**                            | `--cfg-scale 1.0`         |
| **Sampler**         | Set by Unsloth                   | `--sampling-method euler` |
| **Negative prompt** | Not used                         | Not used                  |
| **Size**            | `1024×1024` to start, up to 2048 | `-W 1024 -H 1024`         |
| **Prompt enhancer** | On (6.9 GB download)             | Not available             |
| **Seed**            | Any number to repeat a result    | `--seed 42`               |

### Example outputs <a href="#example-outputs" id="example-outputs"></a>

A100 40 GB, 1024 × 1024, 16 steps, guidance 1, seed 42.

| Prompt                                                                           | Model             | Enhancer  | Time                 |
| -------------------------------------------------------------------------------- | ----------------- | --------- | -------------------- |
| A lighthouse on a coastal cliff at golden hour                                   | GGUF UD-Q4\_K\_XL | On        | 23.5 s (first image) |
| A lighthouse on a coastal cliff at golden hour                                   | GGUF UD-Q4\_K\_XL | Off       | 4.3 s                |
| A bison in a misty geothermal landscape at dawn                                  | GGUF UD-Q4\_K\_XL | Off (API) | 4.5 s                |
| A chalkboard menu outside a small cafe that says "Unsloth Coffee", morning light | Fast FP8, bf16    | Off (API) | 3.4 s                |
| A tiny knitted robot watering a houseplant on a windowsill                       | Fast FP8, INT8    | Off (API) | 2.7 s                |

The first Fast FP8 image after loading takes about 16 s while Unsloth compiles the model.

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>FLUX.3 Image Klein is not in the model picker</summary>

[Update Unsloth](https://unsloth.ai/docs/get-started/install/updating) and restart. If a model is loaded, the picker opens on **On Device**: click **Recommended**.

</details>

<details>

<summary>Enhance prompt is on, but my prompt is not enhanced</summary>

Click **Download** under **Enhance prompt**. The Recipe shows an **Enhanced prompt** row when it ran. The API never runs it.

</details>

<details>

<summary>I run out of GPU memory</summary>

Turn **Enhance prompt** off, or use a smaller quant such as UD-Q3\_K\_XL.

</details>

<details>

<summary>The API ignores the model I asked for</summary>

Load Klein on the Images page, or turn on **Switch image and video model by request** in **Settings → API**.

</details>

<details>

<summary>sd-cli says libcudart.so.12 or libcudart.so.13 is missing</summary>

Use the `cuda13` zip with CUDA 13, `cuda12` with CUDA 12, or the Vulkan build.

</details>

See also [How to Run Image Diffusion Models Locally](https://unsloth.ai/docs/basics/diffusion-image.md).


---

# 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/models/flux-3.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.
