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

# FLUX 3 Image: Lokal ausführen

FLUX.3 Image Klein lokal mit Unsloth FP8 und GGUF-Quantisierungen ausführen und feinabstimmen – mit Prompt-Verbesserung, Bildbearbeitung und LoRA-Training.

**FLUX.3 Image Klein** ist das Text-zu-Bild- und Bildbearbeitungsmodell von Black Forest Labs mit 5,6 Mrd. Parametern, einem Qwen3-VL-4B-Textencoder und **16 Schritten**. Ein Bild mit 1024 × 1024 Pixeln dauert in Unsloth auf einer A100 mit 40 GB etwa **3 bis 5 Sekunden** .

{% columns %}
{% column width="50%" %}
Klein bevorzugt lange, detaillierte Prompts. Der **Prompt-Optimierer** formuliert sie aus einer kurzen Idee.

Die Quants verwenden [Unsloth Dynamic](https://unsloth.ai/docs/basics/dynamic-3.0-ggufs), wodurch wichtige Layer mit höherer Präzision erhalten bleiben. Führe sie in [Unsloth](https://unsloth.ai/docs/de/desktop.md), stable-diffusion.cpp und weiteren Umgebungen aus.

* 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-Optimierer: [GGUF](https://huggingface.co/unsloth/flux-3-image-klein-pup-GGUF)

Getestet mit Unsloth 2026.11.4 auf einer NVIDIA A100 (40 GB).
{% endcolumn %}

{% column width="50%" %}

<figure><img src="https://797013937-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, Optimierer aktiviert. Prompt: „Ein Leuchtturm auf einer Küstenklippe zur goldenen Stunde“</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

<div><figure><img src="https://797013937-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://797013937-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-Repository, bf16</p></figcaption></figure> <figure><img src="https://797013937-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-Repository, INT8</p></figcaption></figure></div>

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

| Modell                      | Schritte und Guidance     | Verwendung                                         |
| --------------------------- | ------------------------- | -------------------------------------------------- |
| **FLUX.3 Image Klein**      | 16 Schritte, Guidance 1   | Bilder erstellen und bearbeiten. **Hier starten.** |
| **FLUX.3 Image Klein Base** | 50 Schritte, Guidance 3,5 | [LoRA-Training](#train-a-lora) und Forschung       |

Klein ist aus Base destilliert; Unsloth legt für beide die Schrittzahl und Guidance fest. Hier wurde nur Klein getestet.

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

| Deine Hardware                    | Beginne mit                                                                  |
| --------------------------------- | ---------------------------------------------------------------------------- |
| **GPU mit mindestens 24 GB**      | **FLUX.3 Image Klein (Fast FP8)**. Unsloth wählt die passende Präzision aus. |
| **GPU mit 12 bis 16 GB**          | GGUF **UD-Q4\_K\_XL**. Möglicherweise musst du den Enhancer deaktivieren.    |
| **GPU mit höchstens 8 GB**        | GGUF **UD-Q3\_K\_XL** oder **UD-Q2\_K\_XL**, Enhancer deaktiviert            |
| **Mac mit mindestens 16 GB**      | GGUF **UD-Q4\_K\_XL**                                                        |
| **Nur CPU, mindestens 16 GB RAM** | GGUF **UD-Q4\_K\_XL** (langsam)                                              |

Die übrigen Zeilen sind Schätzungen. Gemessen auf der 40-GB-A100 (`nvidia-smi`, obere Grenzwerte):

| Geladene Komponenten                                              | Belegter GPU-Speicher |
| ----------------------------------------------------------------- | --------------------- |
| GGUF UD-Q4\_K\_XL + INT8-Text-Encoder, betriebsbereit             | 9,3 GB                |
| Dasselbe, plus Prompt-Enhancer                                    | etwa 17 GB            |
| Dasselbe während der Generierung                                  | etwa 22 GB            |
| Schneller FP8-Einstieg (bf16-Gewichte) + Enhancer beim Bearbeiten | etwa 27 GB            |

Mit stable-diffusion.cpp: UD-Q4\_K\_XL + Q8\_0-Text-Encoder + VAE verwendet **8,0 GB VRAM** (L4).

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

* **FLUX.3 Image Klein (Fast FP8)** lädt das [FP8-Repository](https://huggingface.co/unsloth/flux-3-image-klein-FP8) (etwa 17 GB) herunter, das bf16-, FP8- und INT8-Gewichte enthält. Mit **Präzision** auf **Auto**wählt Unsloth aus, was passt: Auf unserer 40-GB-A100 blieb es bei **bf16**. **INT8** lädt die INT8-ConvRot-Datei. Der Text-Encoder wurde immer als INT8-ConvRot ausgeführt. **FP8** erfordert eine GPU mit FP8-Unterstützung (nicht getestet).
* **flux-3-image-klein-GGUF (langsam)** lädt nur die von dir ausgewählte Quantisierung herunter und läuft auch auf Macs und CPUs.

<figure><img src="https://797013937-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-Datei       | Größe  | Hinweise            |
| ---------------- | ------ | ------------------- |
| **BF16**         | 11 GB  | Volle Genauigkeit   |
| **Q8\_0**        | 6,1 GB | Am nächsten an BF16 |
| **UD-Q5\_K\_XL** | 4,5 GB |                     |
| **UD-Q4\_K\_XL** | 3,9 GB | **Empfohlen**       |
| **UD-Q3\_K\_XL** | 3,3 GB | Für kleine GPUs     |
| **UD-Q2\_K\_XL** | 2,6 GB | Am kleinsten        |

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

Hierfür ist Unsloth 2026.11.5 oder neuer erforderlich.

* **T4 und andere GPUs ohne bf16:** Klein und Klein Base laufen mit fp16 und INT8-Gewichten. Auf einer 15-GB-Colab-T4 bei 1024 x 1024:

  | Aufgabe                               | Zeit pro Bild |
  | ------------------------------------- | ------------- |
  | Klein, Text zu Bild                   | 34 bis 38 s   |
  | Klein Base, Text zu Bild, 12 Schritte | etwa 54 s     |
  | Klein-Bearbeitung                     | etwa 96 s     |
  | Klein-Base-Bearbeitung                | etwa 130 s    |

  Bei der Bearbeitung erreicht der GPU-Speicherbedarf Spitzenwerte von etwa 9,1 GB. Der **Standard** Geschwindigkeitsmodus läuft nicht mehr langsamer als **Aus** auf diesen Karten. LoRAs werden geladen und gerendert. Für das Training ist eine bf16-GPU (Ampere oder neuer) erforderlich; auf einer T4 verweigert Unsloth den Start mit "This trainer requires a bfloat16-capable GPU".
* **AMD unter Linux** (Radeon 8060S, gfx1151): Das Training einer Klein-Base-LoRA mit **bf16** und **nf4** Basismodellen, erneutes Laden und Rendern mit der LoRA auf Klein sowie der Export funktionieren. Die **int8**, **fp8** und **mxfp8** Basismodelle sind nur für NVIDIA geeignet.
* **AMD unter Windows** (gfx1151): Das LoRA-Training funktioniert; ohne C++-Compiler wird ohne torch.compile trainiert und eine Warnung angezeigt. Renderings mit 512 px, die in älteren Builds nur Rauschen ergaben, sind jetzt korrekt.

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

<figure><img src="https://797013937-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>Der Unsloth-Workflow – beschleunigt</p></figcaption></figure>

{% stepper %}
{% step %}

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

Lade die [Unsloth-Desktop-App](https://unsloth.ai/docs/de/desktop.md) für [macOS](https://unsloth.ai/docs/de/loslegen/install/mac.md), [Windows](https://unsloth.ai/docs/de/loslegen/install/windows-installation.md) oder [Linux](https://unsloth.ai/docs/de/loslegen/install/linux.md).

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

Oder über das 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 %}

Starte anschließend Unsloth und öffne `http://localhost:8888`:

{% code collapsedlinecount="10" %}

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

{% endcode %}
{% endstep %}

{% step %}

#### Bilder öffnen <a href="#open-images" id="open-images"></a>

Wähle **Bilder** in der Seitenleiste aus. **Erstellen** ist standardmäßig geöffnet.

<figure><img src="https://797013937-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>Die Seite „Bilder“</p></figcaption></figure>
{% endstep %}

{% step %}

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

Klicke auf **Bildmodell auswählen**, suche nach `flux-3-image-klein` und wähle:

* **FLUX.3 Image Klein (Fast FP8)**: NVIDIA-GPUs mit mindestens 24 GB.
* **flux-3-image-klein-GGUF (Slow)**: Wähle eine Quantisierung. **UD-Q4\_K\_XL** wird empfohlen.

<div><figure><img src="https://797013937-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>Suchergebnisse</p></figcaption></figure> <figure><img src="https://797013937-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-Quantisierungen</p></figcaption></figure></div>

Beim ersten Laden werden das Modell, der Textencoder Qwen3-VL-4B und der VAE heruntergeladen.

<figure><img src="https://797013937-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>Erster Download des Eintrags „Fast FP8“</p></figcaption></figure>
{% endstep %}

{% step %}

#### Prompt-Optimierer herunterladen <a href="#download-the-prompt-enhancer" id="download-the-prompt-enhancer"></a>

**Prompt optimieren** ist standardmäßig aktiviert, aber der Optimierer muss separat heruntergeladen werden. Klicke auf **Herunterladen (6,9 GB)**. Bis dahin werden Prompts genau wie eingegeben verarbeitet.

<figure><img src="https://797013937-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>Optimierer noch nicht heruntergeladen</p></figcaption></figure>
{% endstep %}

{% step %}

#### Gib deinen Prompt ein und generiere <a href="#write-your-prompt-and-generate" id="write-your-prompt-and-generate"></a>

Unsloth legt **16 Schritte** und **Anleitung 1**; behalte sie bei. Lege einen Seed fest, um ein Ergebnis zu wiederholen.

<figure><img src="https://797013937-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-Standardeinstellungen</p></figcaption></figure>

**Vorschau** zeigt den erweiterten Prompt; **Als Prompt verwenden** kopiert ihn zum Bearbeiten in das Feld.

<figure><img src="https://797013937-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>Vorschau des erweiterten Prompts</p></figcaption></figure>

Klicke auf **Generieren**. **Rezept** zeigt alle Einstellungen, einschließlich **Erweiterter Prompt**.

<div><figure><img src="https://797013937-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://797013937-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>Rezeptkarte</p></figcaption></figure></div>
{% endstep %}
{% endstepper %}

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

Der Optimierer ist [flux-3-image-klein-pup](https://huggingface.co/unsloth/flux-3-image-klein-pup-GGUF), ein 9B-Modell (UD-Q4\_K\_XL 6,0 GB + Vision-Datei 0,9 GB), das neben Klein auf deiner GPU läuft. Es benötigt etwa **7,5 GB** GPU-Speicher und einige Sekunden pro Bild zusätzlich; das erste Bild dauerte damit 23,5 s. Zu wenig Speicher? Schalte ihn aus und verfasse einen ausführlichen Prompt: Umgebung, Motiv, Handlung, Licht und Stil.

<figure><img src="https://797013937-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>Gleicher Prompt und Seed, Optimierer ausgeschaltet (4,3 s)</p></figcaption></figure>

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

Wähle **Bearbeiten** in der Seitenleiste aus, lade ein Bild hoch, gib eine Anweisung ein und klicke auf **Generieren**. Behalte 16 Schritte und Guidance 1 bei. **Bild hinzufügen** fügt weitere Referenzen hinzu. Wenn **Prompt verbessern** aktiviert ist, analysiert der Optimierer auch dein Bild. Kurze, konkrete Anweisungen funktionieren am besten.

<figure><img src="https://797013937-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>Schneller FP8-Einstieg (bf16): 8,9 s plus Optimierer</p></figcaption></figure>

<div><figure><img src="https://797013937-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>Vorher</p></figcaption></figure> <figure><img src="https://797013937-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>„Male den Leuchtturm mit roten und weißen Streifen und füge ein kleines Segelboot auf dem Meer hinzu“</p></figcaption></figure></div>

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

Siehe [FLUX 3 feinabstimmen](https://unsloth.ai/docs/de/modelle/flux-3/fine-tune-flux-3.md)

#### Vorher und nachher <a href="#before-and-after" id="before-and-after"></a>

Gleicher Prompt und Seed auf Klein, ohne (links) und mit (rechts) der LoRA: `a trtcrd of a cat sitting on a throne holding a golden cup, "queen of cats"`.

<figure><img src="https://797013937-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 Schritte, Seed 42</p></figcaption></figure>

Prompts ohne das Triggerwort ändern sich deutlich weniger. Stable-diffusion.cpp lädt FLUX.3-LoRAs noch nicht.

[Weiter mit der Anleitung zur Feinabstimmung](https://unsloth.ai/docs/de/modelle/flux-3/fine-tune-flux-3.md#before-and-after)

### Mit Code ausführen <a href="#run-from-code" id="run-from-code"></a>

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

Unsloth bietet einen OpenAI-kompatiblen `POST /v1/images/generations` Endpunkt. Lade Klein zuerst auf der Seite „Bilder“; Anfragen verwenden das geladene Modell, sofern **Bild- und Videomodell je nach Anfrage wechseln** in **Einstellungen → API**. Erstelle dort ebenfalls einen API-Schlüssel (siehe [Unsloth API](https://unsloth.ai/docs/de/grundlagen/api.md)); die Beispiele lesen ihn aus `UNSLOTH_API_KEY`.

<figure><img src="https://797013937-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>Einstellungen → API</p></figcaption></figure>

Mit `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 %}

Mit `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` ist `WIDTHxHEIGHT`, 256 bis 2048, in Schritten von 16. `steps` und `guidance` haben standardmäßig die Werte 16 bzw. 1.

**LoRAs über die API** (Unsloth 2026.11.5 oder neuer): Füge `"loras": [{"id": "my-lora", "weight": 1.0}]` zur Anfrage hinzu. Dabei ist `id` der Name in der LoRA-Liste, oder `"loras": []` wenn keine verwendet werden sollen. Ohne `loras`, behalten FP8- und INT8-Ladevorgänge die LoRAs bei, mit denen sie geladen wurden, zum Beispiel nach **Zum Erstellen bereitstellen**.

Bei FP8- und INT8-Ladevorgängen werden LoRAs nur beim Laden des Modells übernommen. Eine Anfrage bei einem solchen Ladevorgang kann die LoRAs verwenden, mit denen das Modell geladen wurde, oder eine Auswahl davon. Eine LoRA, mit der das Modell nicht geladen wurde, führt jedoch zu einem 400-Fehler. Lade das Modell zuerst mit dieser LoRA: Wähle sie auf der Seite „Bilder“ aus und klicke auf **Erneut anwenden**, oder übergib sie beim Laden des Modells als `loras` Ein bf16-Ladevorgang (**Genauigkeit** festgelegt auf **Aus**) akzeptiert bei jeder Anfrage beliebige LoRAs.

{% hint style="info" %}
Die API führt keine Prompt-Optimierung aus. Sende einen ausführlichen Prompt oder erstelle einen mit **Vorschau** auf der Seite „Bilder“.
{% endhint %}

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

Führe GGUF mit `sd-cli` aus [stable-diffusion.cpp](https://github.com/unslothai/stable-diffusion.cpp) (festgelegte Version von Unsloth; keine Prompt-Optimierung).

**1. Lade `sd-cli`** herunter (Linux, CUDA 13). Die [Release-Seite](https://github.com/unslothai/stable-diffusion.cpp/releases/tag/master-982-0518b34-u27b9ddc) enthält außerdem Builds für CUDA 12, Vulkan, CPU, macOS und Windows.

{% 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. Lade das Modell, den Textencoder und die VAE herunter** (ca. 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. Erstelle ein Bild** (14 s auf einer A100, einschließlich Laden):

{% 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 "Ein weißer Leuchtturm auf einer grasbewachsenen Küstenklippe zur goldenen Stunde, Wellen brechen unten an den Felsen, warmes tief stehendes Sonnenlicht, sanfte Wolken über dem Meer, detailreiches Landschaftsfoto" \
  --steps 16 --cfg-scale 1.0 --sampling-method euler \
  -W 1024 -H 1024 --diffusion-fa --seed 42 \
  -o lighthouse-sdcpp.png
```

{% endcode %}

**4. Bearbeite ein Bild** (24 s). Übergib bis zu 10 Referenzbilder mit `-r`. Beschreibe das gesamte bearbeitete Bild, nicht nur die Änderung.

{% 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://797013937-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://797013937-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>

Auf einem Mac oder mit einer CPU verwenden Sie eine GGUF-Quantisierung in der App oder die `Darwin-macOS-arm64` / CPU `sd-cli` Builds (von uns nicht getestet).

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

| Einstellung           | Unsloth (FP8 oder GGUF)                             | stable-diffusion.cpp      |
| --------------------- | --------------------------------------------------- | ------------------------- |
| **Schritte**          | **16**                                              | `--steps 16`              |
| **Guidance / CFG**    | **1**                                               | `--cfg-scale 1.0`         |
| **Sampler**           | Von Unsloth festgelegt                              | `--sampling-method euler` |
| **Negativer Prompt**  | Nicht verwendet                                     | Nicht verwendet           |
| **Größe**             | `1024×1024` als Startwert, bis zu 2048              | `-W 1024 -H 1024`         |
| **Prompt-Optimierer** | Aktiviert (Download: 6,9 GB)                        | Nicht verfügbar           |
| **Seed**              | Eine beliebige Zahl, um ein Ergebnis zu wiederholen | `--seed 42`               |

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

A100 mit 40 GB, 1024 × 1024, 16 Schritte, Guidance 1, Seed 42.

| Prompt                                                                                                   | Modell              | Enhancer          | Zeit                 |
| -------------------------------------------------------------------------------------------------------- | ------------------- | ----------------- | -------------------- |
| Ein Leuchtturm auf einer Küstenklippe zur goldenen Stunde                                                | GGUF UD-Q4\_K\_XL   | Aktiviert         | 23,5 s (erstes Bild) |
| Ein Leuchtturm auf einer Küstenklippe zur goldenen Stunde                                                | GGUF UD-Q4\_K\_XL   | Deaktiviert       | 4,3 s                |
| Ein Bison in einer nebligen Geothermal-Landschaft im Morgengrauen                                        | GGUF UD-Q4\_K\_XL   | Deaktiviert (API) | 4,5 s                |
| Eine Speisekarte auf einer Tafel vor einem kleinen Café mit der Aufschrift „Unsloth Coffee“, Morgenlicht | Schnelles FP8, bf16 | Deaktiviert (API) | 3,4 s                |
| Ein winziger gestrickter Roboter, der eine Zimmerpflanze auf einer Fensterbank gießt                     | Schnelles FP8, INT8 | Deaktiviert (API) | 2,7 s                |

Das erste Fast-FP8-Bild nach dem Laden dauert etwa 16 s, während Unsloth das Modell kompiliert.

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

<details>

<summary>FLUX.3 Image Klein wird nicht in der Modellauswahl angezeigt</summary>

[Unsloth aktualisieren](https://unsloth.ai/docs/get-started/install/updating) und neu starten. Wenn ein Modell geladen ist, wird die Modellauswahl geöffnet unter **On Device**: Klicke auf **Recommended**.

</details>

<details>

<summary>„Enhance prompt“ ist aktiviert, aber mein Prompt wird nicht verbessert</summary>

Klicke unter **Download** auf **Enhance prompt**. In der Recipe wird eine Zeile **Enhanced prompt** angezeigt, wenn die Funktion ausgeführt wurde. Die API führt sie nie aus.

</details>

<details>

<summary>Mein GPU-Speicher reicht nicht aus</summary>

Deaktiviere **Enhance prompt** oder verwende eine kleinere Quantisierung, z. B. UD-Q3\_K\_XL.

</details>

<details>

<summary>Die API ignoriert das angeforderte Modell</summary>

Lade Klein auf der Seite „Images“, oder aktiviere **Switch image and video model by request** unter **Settings → API**.

</details>

<details>

<summary>sd-cli meldet, dass libcudart.so.12 oder libcudart.so.13 fehlt</summary>

Verwende die `cuda13` ZIP-Datei mit CUDA 13, die `cuda12` mit CUDA 12 oder den Vulkan-Build.

</details>

Siehe auch [So führst du Bilddiffusionsmodelle lokal aus](https://unsloth.ai/docs/de/grundlagen/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/de/modelle/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.
