Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

docs: document model, quantization and upscale changes from recent PRs

Alexander Eichhorn5e97dbba225b
diff --git a/docs/src/config/redirects.ts b/docs/src/config/redirects.ts
index 35f7a199be..1fefcb4381 100644
--- a/docs/src/config/redirects.ts
+++ b/docs/src/config/redirects.ts
@@ -34,7 +34,9 @@ const redirects: RedirectsConfig = {
'/contributing/INVOCATIONS': '/development/architecture/invocations',
'/contributing/LOCAL_DEVELOPMENT': '/development/setup/dev-environment',
'/contributing/MODEL_MANAGER': '/development/architecture/model-manager',
- '/contributing/NEW_MODEL_INTEGRATION': '/development/guides/models',
+ '/contributing/NEW_MODEL_INTEGRATION': '/contributing/new-model-integration',
+ // Superseded by the contributor guide, which tracks the current architecture.
+ '/development/guides/models': '/contributing/new-model-integration',
'/contributing/PR-MERGE-POLICY': '/development/process/pr-merge-policy',
'/contributing/TESTS': '/development/guides/tests',
'/contributing/contribution_guides/development': '/development',
diff --git a/docs/src/content/docs/Users Guide/03.Models/01.introduction.mdx b/docs/src/content/docs/Users Guide/03.Models/01.introduction.mdx
index 7022baf8b8..1b629ecf57 100644
--- a/docs/src/content/docs/Users Guide/03.Models/01.introduction.mdx
+++ b/docs/src/content/docs/Users Guide/03.Models/01.introduction.mdx
@@ -52,6 +52,27 @@ In this situation, you may need to provide some additional information to identi
[set up in the config file]: ../../configuration/invokeai-yaml
+## Quantized model formats
+
+Many models are also published in smaller, quantized builds. InvokeAI recognizes the format from the file's contents, so you install them like any other model:
+
+- **GGUF** (`.gguf`, llama.cpp quantization such as Q4_K or Q8_0): weights stay packed in memory and are unpacked layer by layer during generation. Supported for the FLUX.1, FLUX.2, Z-Image, Krea-2, Qwen-Image and Wan transformers, and for the T5, Qwen3, Qwen3-VL, Mistral and Gemma 2 text encoders.
+- **NF4** (bitsandbytes): 4-bit, CUDA only.
+- **SDNQ**: see [SDNQ Quantization](/configuration/optimization/sdnq-quantization/).
+- **int8** (`int8_convrot`, from ComfyUI repackages): the weights stay int8 in memory on every device, including Apple Silicon, and need no setting to turn on. Supported for FLUX.1, FLUX.2 Klein, Z-Image, Krea-2, Ideogram 4, MiniMax H3, LTX-2 and the PiD decoders, and for the Qwen3 8B, Qwen3-VL and LTX-2 Gemma encoders.
+- **nvfp4** (4-bit, from Comfy-Org): the weights stay packed in memory and are unpacked per layer, so no special GPU is needed. Supported for the Z-Image, Krea-2, Qwen-Image and LTX-2 transformers and for the Qwen3, Qwen2.5-VL and FLUX.2 Mistral encoders; the Ideogram 4 nvfp4 files are refused at install.
+- **fp8** (plain or `fp8_scaled`): InvokeAI keeps the weights in fp8 when [FP8 Storage](/configuration/optimization/fp8-storage/) is on, which installation does for you, or when `fp8_compute` is enabled.
+- **MXFP8** (fp8 with one scale per block of 32 weights): loaded by unpacking to BF16. Turn FP8 Storage off for these; see the [FP8 Storage caution](/configuration/optimization/fp8-storage/).
+
+## How models are identified
+
+InvokeAI identifies a model from the file itself, and falls back to its name only where the contents are the same:
+
+- **Standalone 16-channel VAEs.** FLUX.1 and SD3 use the same VAE network with different settings. A diffusers `vae/` folder is identified by its `config.json`, so FLUX.1-dev's folder is filed as FLUX.1 and SD3.5's as SD3. A single file such as `sd3_vae.safetensors` is identified by its name, folder or download source; if none of them names a model family, it is filed as FLUX.1. If a VAE lands under the wrong base, change **Base** in the model's **Edit** view. A `vae/` folder installed before this detection existed can be fixed with **Reidentify**.
+- **FLUX.2 Klein 9B vs. Klein 9B Base.** The two are identical in structure, so the file or repo name decides, and they ship different default step counts (4 against 28). Names that say "distilled" are read as Klein 9B even when they also contain "base". If you installed `Winnougan/Klein9b-Distilled-Base-INT8-Convrot` by repo ID before this was fixed, it was filed as Klein 9B Base; remove and reinstall it.
+
+Text encoders for Qwen-Image, Z-Image, Krea-2 and Ideogram 4 bring their tokenizer and configuration with InvokeAI, so single-file and GGUF encoders load without network access.
+
## Ideogram 4
Ideogram 4 is an open-weight text-to-image model with a distinctive **structured JSON prompt**: instead of a single sentence, the model is trained to read an overall scene description plus a list of regions, each with a bounding box and its own text. Invoke assembles this JSON for you.
@@ -71,7 +92,7 @@ Comfy-Org's [`Comfy-Org/Ideogram-4`](https://huggingface.co/Comfy-Org/Ideogram-4
- `diffusion_models/ideogram4_<build>.safetensors` — the conditional branch, selected as the model
- `diffusion_models/ideogram4_unconditional_<build>.safetensors` — the unconditional branch
-- `text_encoders/qwen3vl_8b_fp8_scaled.safetensors` — the Qwen3-VL **8B** encoder (not the 4B one Krea-2 uses)
+- `text_encoders/qwen3vl_8b_fp8_scaled.safetensors` — the Qwen3-VL **8B** encoder (not the 4B one Krea-2 uses). A llama.cpp GGUF of the 8B encoder works as well; see [Qwen3-VL GGUF encoders](/users-guide/models/local-models/krea-2/#qwen3-vl-gguf-encoders).
- `vae/flux2-vae.safetensors` — the 32-channel VAE, shared with FLUX.2, which is why it installs under the FLUX.2 base
Pick the unconditional branch, the encoder and the VAE in the **Components** section next to the model — and pick the unconditional branch of the *same* build as the model. The `nvfp4` repackage in that repo is **not** supported yet and is refused at install.
@@ -92,11 +113,19 @@ Both branches are resident at once, so double those figures for the pair.
**Without the fp8 matmul, the fp8 build still works — through FP8 Storage.** That setting keeps the file's own fp8 weights and per-tensor scales instead of expanding them, and installation switches it on for these files by itself. Measured on a 4090 with `fp8_compute` off, 1024px: **40.6 s**, 22.9 GB peak, 8.7 GB resident per branch — against **45.7 s** for the int8 pair. With *neither* the matmul nor Storage the weights are expanded to bf16 on load, 17.3 GB per branch, and a 24 GB card runs out of memory during the first step.
-**Use int8 where FP8 Storage is not available.** It requires a CUDA device; on anything else the fp8 build falls back to the expanded path, while int8 keeps its stored codes and dequantizes them per forward on any device with no setting to turn on.
+**Use int8 where FP8 Storage is not available.** It requires a CUDA or Intel XPU device; on anything else the fp8 build falls back to the expanded path, while int8 keeps its stored codes and dequantizes them per forward on any device with no setting to turn on.
On a 24 GB NVIDIA card without the fp8 matmul (RTX 30-series), the int8 pair plus the 8B encoder still adds up to more than the card holds, so the bundled [nf4 build](#installing-ideogram-4) remains the smaller option there.
:::
+### Memory use during generation
+
+Ideogram 4 keeps both transformer branches loaded for the whole generation. With the single-file builds on a CUDA or ROCm GPU (with partial loading on, the default), InvokeAI checks whether the pair fits next to the working memory a generation needs. If it does not, it keeps only part of the second branch on the GPU and streams the rest in each step. On a 24 GB card with the fp8 pair this keeps about 2.4 GB free instead of 1.2 GB. The bundled nf4 and fp8 folders are not affected. Three things follow:
+
+- A streamed layer computes on a slightly different path, so images at the same seed can differ from those generated with both branches fully on the GPU.
+- If generations still run out of memory, raise `device_working_mem_gb` in `invokeai.yaml` (for example to `8`).
+- If you set `max_cache_vram_gb`, InvokeAI does not limit the second branch this way, because the cache already plans from that limit.
+
### Prompting Ideogram 4
When an Ideogram 4 model is selected, Invoke builds the structured JSON prompt automatically:
@@ -122,6 +151,15 @@ Ideogram 4 ships with a **content safety filter baked into the released model we
The filter is known to **false-positive on completely benign prompts**, and the quantized builds can trigger it more readily. Invoke always sends the model a structured JSON prompt, which tends to trip the filter less than plain text; if you hit it, rephrasing or adjusting the prompt usually clears it.
:::
+## ERNIE-Image
+
+ERNIE-Image is Baidu's 8B text-to-image model, available as **ERNIE-Image** (50 steps, CFG 4.0) and the distilled **ERNIE-Image Turbo** (8 steps, CFG off). Both are in the starter models in two forms:
+
+- **Diffusers pipelines** (`baidu/ERNIE-Image`, `baidu/ERNIE-Image-Turbo`) — everything in one folder, including the prompt enhancer.
+- **Single files** from Comfy-Org (~16 GB each) — the transformer alone. The starter installs it together with the **ERNIE-Image Ministral Encoder** (Ministral 3B, ~7.7 GB) and the FLUX.2 VAE. Select the encoder and the VAE in the **Components** section next to the model. The single files have no prompt enhancer.
+
+The Ministral 3B encoder is not the Mistral Small 3 encoder FLUX.2 uses, and the two cannot replace each other. The prompt enhancer from the diffusers folder has the same shape as the encoder but is refused as one, with a message naming the file to install instead.
+
## Editing model metadata
Every model has an editable **Source URL** field alongside its name and description. Use it to record where a model came from — for example a Civitai or HuggingFace page — independent of how it was originally installed. The URL is editable from the model's **Edit** view and appears as a clickable link in the model header once set. Models without a URL simply hide the field.
diff --git a/docs/src/content/docs/Users Guide/03.Models/Local Models/krea-2.mdx b/docs/src/content/docs/Users Guide/03.Models/Local Models/krea-2.mdx
index 7231220077..239e66f188 100644
--- a/docs/src/content/docs/Users Guide/03.Models/Local Models/krea-2.mdx
+++ b/docs/src/content/docs/Users Guide/03.Models/Local Models/krea-2.mdx
@@ -1,7 +1,7 @@
---
title: Krea-2
description: Generate images with the Krea-2 text-to-image models (Turbo and Raw), including the GGUF / single-file workflow, the conditioning enhancers and training-free style reference.
-lastUpdated: 2026-08-20
+lastUpdated: 2026-09-30
sidebar:
order: 5
---
@@ -22,7 +22,20 @@ The variant is detected automatically on install, and selecting a Krea-2 model s
Krea-2 is a large model. See the [System Requirements](/start-here/system-requirements/) table for
details. In short, on a 24 GB card enable **FP8** in the model's Default Settings to fit 1024² (with a
-LoRA). For lower VRAM, use a **GGUF** transformer (Q4_K ≈ 12 GB total).
+LoRA). For lower VRAM, use a smaller transformer build:
+
+| Transformer build | Transformer size | Notes |
+| --------------------------- | ---------------- | ----------------------------------------------------------- |
+| NVFP4 (starter model) | ≈ 7.2 GiB | stays packed, unpacked per layer on any GPU |
+| GGUF Q4_K_M (starter model) | ≈ 7 GB | stays packed, unpacked per layer |
+| GGUF Q8_0 (starter model) | ≈ 13 GB | near-full quality |
+| int8 (`int8_convrot`) | ≈ 12.6 GiB | stays int8 on every device, no FP8 setting needed |
+| fp8 / `fp8_scaled` | ≈ 12.6 GB | with FP8 Storage (switched on at install) or `fp8_compute` |
+| MXFP8 | ≈ 24 GB | unpacked to BF16 at load; prefer the fp8, NVFP4 or GGUF build |
+
+The Qwen3-VL encoder and the small VAE come on top of these sizes. The encoder takes about 8.5 GB as bf16
+(the starter bundle's encoder), about half that as fp8, and about 2.8 GB as a Q4_K_M
+[GGUF Qwen3-VL encoder](#qwen3-vl-gguf-encoders).
## Installing
@@ -33,7 +46,7 @@ Krea-2 needs three components:
| Component | Diffusers install | GGUF / single-file install |
| ----------------------- | ----------------------- | ------------------------------------ |
-| Transformer | bundled in the pipeline | the `.gguf` / single-file checkpoint |
+| Transformer | bundled in the pipeline | the `.gguf` / single-file checkpoint (GGUF, fp8, int8, NVFP4, MXFP8) |
| VAE (Qwen-Image) | bundled | installed separately |
| Text encoder (Qwen3-VL) | bundled | installed separately |
@@ -53,6 +66,20 @@ with InvokeAI, so these encoders load without network access. A single-file fp8
resident in fp8 (roughly half the VRAM of the bf16 encoder).
:::
+### Qwen3-VL GGUF encoders
+
+The Qwen3-VL encoder can also be a llama.cpp GGUF, for the 4B encoder Krea-2 uses and for the 8B encoder
+Ideogram 4 uses. A Q4_K_M 4B file is about 2.5 GB and takes about 2.8 GB of VRAM, against 8.5 GB for
+the bf16 safetensors encoder, so encoder and transformer fit on the GPU together. Images match the bf16
+encoder closely; the remaining difference is the quantization of the encoder.
+
+- Use a Qwen3-VL GGUF, such as the files in `Qwen/Qwen3-VL-4B-Instruct-GGUF`. A plain Qwen3 GGUF has the
+ same shapes but conditions wrongly, so InvokeAI identifies the encoder from the file's
+ `qwen3vl` architecture tag and does not install a plain Qwen3 file as one.
+- The `mmproj-*.gguf` file next to it holds the vision part and is not needed. Installing it is refused
+ with a message saying so.
+- LoRAs with text-encoder layers still apply to a quantized encoder.
+
## Conditioning enhancers
Two optional, off-by-default toggles are available under **Advanced Options** (below CFG Scale). They
@@ -123,4 +150,16 @@ Strength**. In the workflow editor the same thing is the **Style Reference - Kre
## LoRA
Krea-2 LoRAs (diffusers PEFT format) are supported and apply to both the transformer and — where the
-LoRA includes text-encoder layers — the Qwen3-VL encoder.
+LoRA includes text-encoder layers — the Qwen3-VL encoder. On quantized builds (GGUF, int8, NVFP4) the LoRA
+is applied alongside the packed weights rather than merged into them.
+
+## Attention backend
+
+On CUDA, Krea-2 picks the fastest available attention kernel by itself (Flash Attention where the PyTorch
+build has it, then cuDNN, then memory-efficient attention). For benchmarking or support questions you
+can force one kernel with the environment variable `INVOKE_KREA2_SDPA_BACKEND`: `flash`, `cudnn`,
+`efficient` or `math`, or `default` for the automatic order. A forced kernel that the GPU or build does
+not support raises an error instead of quietly falling back, and an unknown value stops InvokeAI at startup.
+
+Any value, `default` included, also turns on per-step timing in the log, which synchronizes the GPU after
+every step and slows generation slightly. Unset the variable for normal use.
diff --git a/docs/src/content/docs/Users Guide/04.Image Generation/upscale.mdx b/docs/src/content/docs/Users Guide/04.Image Generation/upscale.mdx
new file mode 100644
index 0000000000..f7be21b168
--- /dev/null
+++ b/docs/src/content/docs/Users Guide/04.Image Generation/upscale.mdx
@@ -0,0 +1,46 @@
+---
+title: Upscaling
+lastUpdated: 2026-09-30
+sidebar:
+ order: 7
+---
+
+The **Upscale** panel enlarges an image and adds detail in two passes. First a Spandrel upscaling model (such as a Real-ESRGAN variant) enlarges the image. Then a main model runs a short image-to-image pass over the result to invent detail that fits your prompt.
+
+Open it from the left rail. It is available in the Compose, Edit and Video layouts.
+
+## Setting up an upscale
+
+The panel is split into sections, top to bottom:
+
+- **Source & treatment**
+ - **Source image**: pick an image from the gallery, drag one in, or upload one.
+ - **Spandrel model**: the first-pass upscaler. Choose one suited to your image: photography, illustration or linework.
+ - **Scale**: the output size is the source size multiplied by this value. The panel shows the resulting input and output size and warns when the output is large enough to need much more time and VRAM.
+ - **Treatment preset**, or **Creativity** and **Structure** directly. Higher Creativity invents more detail and gives the prompt more influence. Higher Structure keeps the source composition more strictly; it is only shown for models that use a Tile ControlNet.
+- **Detail guidance**: the prompt. It is the project prompt shared with Generate. For upscaling, describe the medium, texture and style rather than new content.
+- **Generation**: the **Main model** for the detail pass (**SD1.5**, **SDXL** or **FLUX.1**), steps, CFG scale, scheduler, seed, and LoRAs that match the main model.
+- **Advanced**: the components the main model needs (see below), tile size and tile overlap, VAE and VAE precision, and CLIP skip for SD1.5.
+
+## What each model family needs
+
+| | SD1.5 / SDXL | FLUX.1 |
+|---|---|---|
+| Tile ControlNet | Required: a Tile or Union ControlNet for the same family, under **Advanced** | Not used; the Structure slider is hidden |
+| Negative prompt | Available | Not used; FLUX.1 ignores it, so it is hidden and not recorded |
+| Other components | Taken from the main model | Every FLUX.1 model except an SDNQ pipeline needs a **T5 Encoder**, **CLIP Embed** and **VAE**, all under **Advanced**. SDNQ pipelines bring their own. FLUX Fill models cannot be used |
+| Detail pass | Tile by tile | One pass over the whole image |
+
+The panel says what is missing before you can queue, for example "Select a compatible Tile or Union ControlNet." or "This model needs a T5 encoder selected."
+
+:::note[FLUX.1 output size]
+FLUX.1 needs sizes that are a multiple of 16. When the enlarged image is not, the panel shrinks it slightly to the nearest fitting size before the detail pass — for example 2040 px becomes 2032 px.
+:::
+
+## Memory
+
+For SD1.5 and SDXL the detail pass works in tiles, so the output can be much larger than what the model generates in one go. Larger tiles can improve continuity but need more VRAM; more tile overlap reduces seams but costs time and memory.
+
+For FLUX.1 the detail pass runs over the whole image at once, so its memory use grows with the output size. There, **Tile size** only sets the tiles for the VAE encode and decode, and **Tile overlap** has no effect.
+
+For all model families, encoding and decoding the enlarged image with the VAE runs in tiles. See [Low-VRAM mode](/configuration/optimization/low-vram-mode/) if you still run out of memory.
diff --git a/docs/src/content/docs/configuration/Optimization/fp8-storage.mdx b/docs/src/content/docs/configuration/Optimization/fp8-storage.mdx
index e98a5b7e3f..4c93a22b8c 100644
--- a/docs/src/content/docs/configuration/Optimization/fp8-storage.mdx
+++ b/docs/src/content/docs/configuration/Optimization/fp8-storage.mdx
@@ -6,17 +6,17 @@ sidebar:
import { Steps } from '@astrojs/starlight/components';
-FP8 Storage cuts a model's VRAM footprint roughly in half by keeping weights on the GPU in 8-bit floating-point format (`float8_e4m3fn`). During inference, each layer's weights are cast on-the-fly back up to the compute precision (FP16/BF16), then cast back to FP8 after the forward pass — so quality is largely preserved.
+FP8 Storage cuts a model's VRAM footprint roughly in half by keeping weights on the GPU in 8-bit floating-point format (`float8_e4m3fn`). During inference, each layer's weights are cast on-the-fly up to the compute precision (FP16/BF16), and the stored FP8 weights are put back after the forward pass — so quality is largely preserved.
It pairs well with [Low-VRAM mode](/configuration/optimization/low-vram-mode/): low-VRAM mode streams layers between RAM and VRAM, while FP8 Storage shrinks the layers themselves.
:::caution[For full precision models only]
-FP8 Storage is meant for **full precision** checkpoints (FP16 / BF16 / FP32). It is **silently a no-op** for **GGUF**, **NF4** and [**SDNQ**](/configuration/optimization/sdnq-quantization/) checkpoints, which carry their own storage precision. **int8** and **nvfp4** single-file checkpoints keep their quantized layers as they are — the loader returns a module type the FP8 layer cast does not touch — so there the toggle reaches only the layers the build ships in full precision, and on an **Ideogram 4** int8 file nothing at all. On single-file checkpoints that ship *scaled* fp8 layers, the toggle keeps those layers in FP8 with their own scale instead of unpacking them; that is what FLUX.1, FLUX.2, Z-Image, Anima, Krea-2, Qwen-Image and Ideogram 4 all do. **MXFP8 is the exception, and there the toggle costs quality:** those files carry one exponent per 32-element block, which no GPU before Blackwell can apply, so the layers are unpacked at load and the toggle then re-encodes them as fp8 *without* any scale. Blocks whose scale sits far below 1 lose their weights to underflow. Leave it off for an MXFP8 checkpoint. If your model is already quantized, use its full-precision variant to get the full effect of FP8 Storage. Checkpoints that store FP8 weights are the exception: InvokeAI loads them at BF16 unless FP8 Storage is on, so they get it automatically when installed (see [When installing](#when-installing)).
+FP8 Storage is meant for **full precision** checkpoints (FP16 / BF16 / FP32). It does nothing for **GGUF**, **NF4** and [**SDNQ**](/configuration/optimization/sdnq-quantization/) checkpoints, which carry their own storage precision, so the Model Manager does not show the toggle for them (see [Where the toggle is shown](#where-the-toggle-is-shown)). **int8** and **nvfp4** single-file checkpoints keep their quantized layers as they are — the loader returns a module type the FP8 layer cast does not touch — so there the toggle reaches only the layers the build ships in full precision, and on an **Ideogram 4** int8 file nothing at all. On single-file checkpoints that ship *scaled* fp8 layers, the toggle keeps those layers in FP8 with their own scale instead of unpacking them; that is what FLUX.1, FLUX.2, Z-Image, Anima, Krea-2, Qwen-Image and Ideogram 4 all do. **MXFP8 is the exception, and there the toggle costs quality:** those files carry one exponent per 32-element block, which no GPU before Blackwell can apply, so the layers are unpacked at load and the toggle then re-encodes them as fp8 *without* any scale. Blocks whose scale sits far below 1 lose their weights to underflow. Leave it off for an MXFP8 checkpoint — and because installing switches it on for every checkpoint with FP8 weights, MXFP8 included, turn it off under **Default Settings** after installing one. If your model is already quantized, use its full-precision variant to get the full effect of FP8 Storage. Checkpoints that store FP8 weights are the exception: InvokeAI loads them at BF16 unless FP8 Storage is on, so they get it automatically when installed (see [When installing](#when-installing)).
:::
## Requirements
-- **Nvidia GPU on Windows or Linux.** FP8 Storage uses CUDA tensor types and is silently disabled on CPU and MPS.
+- **A CUDA or Intel XPU device.** Before first use InvokeAI runs a small FP8 test on the device. If the device, driver or PyTorch build cannot store and upcast `float8_e4m3fn` (some older AMD ROCm GPUs, for example), the test fails, InvokeAI logs a warning and loads the model without FP8. CPU and MPS are never used for FP8 Storage.
- **CUDA 12.x and recent PyTorch.** The `float8_e4m3fn` dtype was added in PyTorch 2.1 — InvokeAI's bundled versions satisfy this.
There is no hardware requirement for FP8 *compute* — InvokeAI casts back to FP16/BF16 for math. This means FP8 Storage works on GPUs that do not natively support FP8 matmul (e.g. RTX 30-series), at a small per-step throughput cost.
@@ -27,7 +27,7 @@ InvokeAI's FP8 path stores weights in FP8 and casts them back to BF16/FP16 on ea
### RTX 30-series and older Ampere workstation cards — VRAM win only
-The toggle works as advertised: the UNet / transformer drops by roughly 50% on the GPU. Per-step latency is the same or marginally slower because every forward pass adds an FP8 → BF16 cast on entry and a BF16 → FP8 cast on exit. This is the **largest target group**: 3090 owners squeezing FLUX into 24 GB benefit the most.
+The toggle works as advertised: the UNet / transformer drops by roughly 50% on the GPU. Per-step latency is the same or marginally slower because every forward pass adds an FP8 → BF16 cast on entry. On exit the stored FP8 weights are simply put back, which costs no extra cast or allocation. This is the **largest target group**: 3090 owners squeezing FLUX into 24 GB benefit the most.
### RTX 40-series, RTX 50-series, and Hopper — VRAM win, plus a compute win via a separate setting
@@ -35,11 +35,11 @@ These GPUs have native FP8 tensor cores. FP8 *Storage* on its own still only buy
### Older CUDA cards — still a VRAM win
-`float8_e4m3fn` is a pure storage dtype in PyTorch and works on any CUDA device, so pre-Ampere cards (GTX 16-series, RTX 20-series, etc.) get the same ~50% VRAM reduction as Ampere. There are no native FP8 tensor cores on these GPUs, so the throughput trade-off is the same as on the 30-series: cast in, compute in BF16/FP16, cast back out.
+`float8_e4m3fn` is a pure storage dtype in PyTorch and works on any CUDA device, so pre-Ampere cards (GTX 16-series, RTX 20-series, etc.) get the same ~50% VRAM reduction as Ampere. There are no native FP8 tensor cores on these GPUs, so the throughput trade-off is the same as on the 30-series: cast in, compute in BF16/FP16, restore the FP8 weights.
### MPS and CPU — no-op
-FP8 Storage is silently disabled on anything that is not CUDA. On CPU PyTorch *technically* supports FP8 dtypes, but the cast operations are software-emulated and end up costing more than the memory savings buy back, so InvokeAI gates the entire path on `device.type == "cuda"`. If you toggle it on CPU or MPS, the loader skips the cast and returns the model unchanged with no log line.
+FP8 Storage is only used on CUDA and Intel XPU devices. On CPU PyTorch *technically* supports FP8 dtypes, but the cast operations are software-emulated and end up costing more than the memory savings buy back. If you toggle it on CPU or MPS, the loader skips the cast and returns the model unchanged with no log line. On a CUDA or XPU device whose FP8 test fails, the log shows `FP8 storage probe failed on <device> ... not using FP8.` once.
## Enabling FP8 Storage
@@ -47,9 +47,9 @@ FP8 Storage is a **per-model setting**, configured from the Model Manager:
<Steps>
1. Open the **Model Manager**.
-2. Select a model (Main, ControlNet, or T2I-Adapter).
-3. Under **Default Settings**, toggle **FP8 Storage (Save VRAM)**.
-4. Click **Save**.
+2. Select a model (Main, ControlNet, or T2I-Adapter). The toggle only appears for models where it has an effect (see [Where the toggle is shown](#where-the-toggle-is-shown)).
+3. Under **Default Settings**, toggle **FP8 storage**.
+4. Click **Save Defaults**.
</Steps>
The setting takes effect on the next load. If the model is already in the cache, InvokeAI evicts the cached copy automatically so the new setting applies — even if a generation is currently using the model (the eviction is deferred until the generation finishes).
@@ -57,8 +57,10 @@ The setting takes effect on the next load. If the model is already in the cache,
### When installing
- **Checkpoints that already store FP8 weights get FP8 Storage automatically.** InvokeAI reads the weight types from the file while identifying the model, not its name, so a full-precision file with "fp8" in its name is not affected. Only the denoiser counts: an all-in-one checkpoint with an FP8 text encoder beside a full-precision UNet or transformer is left alone. Without this, an FP8 checkpoint would be loaded at BF16 and take twice the VRAM.
-- **"Scaled" FP8 checkpoints are included.** Their weights only mean something together with the per-tensor scale stored beside them, and the loader keeps them in exactly that form, so the setting costs no precision at all — it simply stops InvokeAI from unpacking the file to twice its size.
-- **For any other model, tick FP8 storage next to the install source** (a file path, URL or HuggingFace repo, and in folder scan results). It applies to the models you install from there.
+- **"Scaled" FP8 checkpoints are included.** Their weights only mean something together with the per-tensor scale stored beside them, and the loader keeps them in exactly that form, so the setting costs no precision at all — it simply stops InvokeAI from unpacking the file to twice its size. Two exceptions:
+ - **MXFP8** checkpoints are switched on as well, but for them the setting costs quality (see the callout at the top). Turn it off after installing one.
+ - **Wan** checkpoints in ComfyUI's `fp8_scaled` format: the Wan loader cannot keep them packed yet. It declines the setting, logs why, and loads the model at BF16, even though the toggle shows as on.
+- **For any other model, tick FP8 storage next to the install source** (a file path, URL or HuggingFace repo, and in folder scan results). It applies to the models you install from there that support it. For a model whose loader cannot use FP8 Storage the request is dropped, so the model is not recorded with a setting that does nothing.
Either way the setting stays editable under **Default Settings** afterwards. Re-identifying a model resets its default settings, including this one, to what identification chooses.
@@ -70,18 +72,23 @@ Either way the setting stays editable under **Default Settings** afterwards. Re-
FP8 Storage is **only** applied to layers where the precision trade-off is acceptable:
-| Model type | FP8 applied? |
-| ---------------------------------- | ----------------------------------------------- |
-| Main models (SD1, SD2, SDXL) | Yes |
-| FLUX.1 / FLUX.2 Klein | Yes |
-| Z-Image, Anima, Krea-2, Qwen-Image | Yes |
-| Ideogram 4 (single file) | Yes — both transformer branches |
-| ControlNet, T2I-Adapter | Yes |
-| Wan | Not yet — the switch is shown but has no effect |
-| VAE | No — visible decode-quality regression |
-| Text encoders, tokenizers | No — small models, no benefit |
-| Anima ControlNet-LLLite | No — adapter is only tens of MB |
-| LoRA, ControlLoRA | No — patched into base, not run alone |
+| Model type | FP8 applied? |
+| --- | --- |
+| Main models: SD1, SD2, SDXL, SDXL Refiner, SD3, CogView4 | Yes |
+| FLUX.1, FLUX.2 (all variants) | Yes |
+| Z-Image, Anima, Krea-2, Qwen-Image, ERNIE-Image | Yes |
+| Ideogram 4 (single file) | Yes — both transformer branches |
+| LTX-2 | Yes |
+| Wan (checkpoint and diffusers) | Yes — except ComfyUI `fp8_scaled` files, which load at BF16 |
+| ControlNet (SD1, SD2, SDXL), T2I-Adapter | Yes |
+| VAE | No — visible decode-quality regression |
+| Text encoders, tokenizers | No — small models, no benefit |
+| Anima ControlNet-LLLite | No — adapter is only tens of MB |
+| FLUX and Z-Image ControlNet | No — not implemented yet |
+| MiniMax H3 | No — not implemented yet |
+| Ideogram 4 (diffusers folder) | No — published only as nf4 or fp8 |
+| GGUF, NF4 and SDNQ models | No — already quantized |
+| LoRA, ControlLoRA | No — patched into base, not run alone |
Within a supported model, **norm layers, position/patch embeddings, and `proj_in`/`proj_out` are skipped** so precision-sensitive tiny learned scalars (e.g. FLUX `RMSNorm.scale`) aren't crushed to FP8. This mirrors the diffusers default skip list.
@@ -93,10 +100,14 @@ The cost is a slightly smaller saving on the models that declare a lot. Measured
| ------------------------- | ------------------------------------------------ | --------------- |
| Krea-2 | 39 M (`time_embed`) | ~38 MiB |
| Anima | 19 M (`t_embedder`, `x_embedder`, `final_layer`) | ~18 MiB |
-| Wan 14B (not applied yet) | 232 M (`condition_embedder`, `patch_embedding`) | ~221 MiB |
+| Wan 14B | 232 M (`condition_embedder`, `patch_embedding`) | ~221 MiB |
| FLUX.1, Qwen-Image | 0 | 0 |
-Wan is listed for completeness only: no Wan loader applies FP8 Storage yet, so the switch has no effect on Wan models and there is nothing to budget for today.
+Measured on Wan 2.2 TI2V-5B (fp16 single file, 512², 20 steps, RTX 4090), FP8 Storage takes the transformer from 9.5 GB to 4.9 GB resident, at 21.4 s instead of 18.4 s per video.
+
+### Where the toggle is shown
+
+The Model Manager shows the **FP8 Storage** toggle only for models in the "Yes" rows above. For the others it is hidden, because the setting would not change anything. A model installed before this rule may still have FP8 Storage stored as on. The setting stays in the database and does nothing; when such a model loads, the log says so once: `FP8 Storage is set for '<model>' but does nothing here: <reason>`.
## Quality trade-offs
@@ -135,7 +146,7 @@ The loader reports what it kept, naming the setting that kept it — for example
Not every part of a model stays in FP8 — the small, precision-sensitive pieces are always unpacked. Those are a tiny share of the weights, so you still get nearly the full VRAM saving.
-You need an FP8-capable GPU: RTX 40-series or newer, the datacenter cards of those generations, or AMD MI300 and newer. InvokeAI checks your card the first time it needs to — by actually trying a small FP8 operation rather than going by the model name — so a card that can't do it quietly falls back to the normal path instead of failing partway through a generation.
+You need an FP8-capable GPU: RTX 40-series or newer, the datacenter cards of those generations, or an AMD GPU whose ROCm build supports FP8 matmul (MI300, for example). InvokeAI checks your card the first time it needs to — by actually trying a small FP8 operation rather than going by the model name — so a card that can't do it quietly falls back to the normal path instead of failing partway through a generation.
:::danger[Reproducibility requires the model to be fully in VRAM]
With `fp8_compute` enabled, **the same seed only reproduces the same image if the model is 100% resident in VRAM.**
@@ -163,8 +174,8 @@ The cache eviction is immediate for idle models, but **deferred until the next u
If VRAM still hasn't dropped:
-- Check the InvokeAI log for `FP8 layerwise casting enabled for <model name>`. If the line isn't there, the model is on the exclusion list, or its loader does not apply FP8 yet (VAE, text encoder, LoRA, Wan — see table above). For a checkpoint that is already FP8 the expected line is `FP8 storage skipped ... already fp8` instead: nothing needed re-encoding.
-- Confirm you are on CUDA. FP8 Storage is silently disabled on CPU and MPS.
+- Check the InvokeAI log for `FP8 layerwise casting enabled for <model name>`. If the line isn't there, the model is on the exclusion list (VAE, text encoder, LoRA — see table above), or it is a Wan `fp8_scaled` checkpoint, for which the loader logs why it declined. For a checkpoint that is already FP8 the expected line is `FP8 storage skipped ... already fp8` instead: nothing needed re-encoding.
+- Confirm you are on a CUDA or XPU device, and look for `FP8 storage probe failed` in the log. FP8 Storage is not used on CPU and MPS.
### Quality regression on a specific model
@@ -179,7 +190,7 @@ You're on a PyTorch version that predates FP8 support. Reinstall InvokeAI using
If FP8 Storage misbehaves — crash, quality regression, OOM that shouldn't happen — please [open a GitHub issue](https://github.com/invoke-ai/InvokeAI/issues/new/choose) and include:
- **What you did**: the workflow / generation step that triggered the problem, and whether it reproduces every time.
-- **Model**: exact name and variant (e.g. "FLUX.2 Klein 9B Diffusers", "SDXL Base 1.0 single-file"), and whether the file is a full-precision checkpoint or already quantized (GGUF / NF4 / SDNQ / int8 / nvfp4).
+- **Model**: exact name and variant (e.g. "FLUX.2 Klein 9B Diffusers", "SDXL Base 1.0 single-file"), and whether the file is a full-precision checkpoint or already quantized (GGUF / NF4 / SDNQ / int8 / nvfp4 / scaled fp8 / MXFP8).
- **LoRAs**: whether any LoRAs (or ControlLoRAs) are stacked on the model, and how many.
- **Other toggles**: Low-VRAM mode on/off, any `cpu_only` text encoder setting, configured VRAM limit.
- **GPU**: model and VRAM size (e.g. "RTX 3090 24 GB", "RTX 4070 Ti 12 GB").
diff --git a/docs/src/content/docs/configuration/Optimization/low-vram-mode.mdx b/docs/src/content/docs/configuration/Optimization/low-vram-mode.mdx
index 1d196dcaa5..96df21f3a2 100644
--- a/docs/src/content/docs/configuration/Optimization/low-vram-mode.mdx
+++ b/docs/src/content/docs/configuration/Optimization/low-vram-mode.mdx
@@ -164,6 +164,16 @@ Invoke has the option of keeping a RAM copy of all model weights, even when they
keep_ram_copy_of_weights: false
```
+### Tiled VAE decode and encode
+
+Without tiling, the memory a VAE needs grows with the square of the image size. For FLUX.1, an untiled 3072² encode peaks at about 18.8 GiB on an RTX 4090, and a tiled one at 0.8 GiB, while tiled memory stays roughly flat as the image grows. Tiling costs some speed on smaller images.
+
+- **Always tile:** set `force_tiled_decode: true` in `invokeai.yaml`. It covers the VAE decode and encode for SD1.5/SDXL, FLUX.1, Z-Image and Qwen-Image, the Anima encode, and the Krea-2 style reference. Other model families (for example SD3, FLUX.2, Wan and LTX-2) ignore it.
+- **Per node:** the SD, FLUX.1, Z-Image and Qwen-Image **Latents to Image** and **Image to Latents** nodes, and **Image to Latents - Anima**, have **Tiled** and **Tile Size** fields for workflows. The [Upscale panel](/users-guide/image-generation/upscale/) turns tiling on by itself.
+- **Automatic retry:** if a FLUX.1, Z-Image or Anima decode, or a FLUX.1 encode, runs out of memory, InvokeAI retries it once with tiling and logs that it did.
+
+A tiled decode is not pixel-identical to a single-pass one. The VAE looks at the whole image at once, so the difference is spread over the image rather than limited to the tile seams; it is small, but the same seed will not reproduce an untiled result exactly.
+
### PiD decode optimization
PiD decodes directly into high-resolution pixels, so its activation and sampler memory can exceed the working memory needed by a normal VAE decode. Partial model loading reduces memory used by PiD's weights, but does not reduce these full-resolution intermediates.
diff --git a/docs/src/content/docs/configuration/Optimization/sdnq-quantization.mdx b/docs/src/content/docs/configuration/Optimization/sdnq-quantization.mdx
index f7a153e943..70a10fffe3 100644
--- a/docs/src/content/docs/configuration/Optimization/sdnq-quantization.mdx
+++ b/docs/src/content/docs/configuration/Optimization/sdnq-quantization.mdx
@@ -103,7 +103,10 @@ If you need higher quality and have the VRAM, the static `Disty0/FLUX.2-klein-9B
| **SDNQ uint4 + SVD** | ~50 % | ~50 % | ✅ sidecar | Full diffusers pipeline |
| **GGUF Q4_K_M** | ~30 % | ~30 % | ✅ sidecar | Single-file transformer + separate encoders/VAE |
| **BnB NF4** | ~50 % | ~50 % | ✅ sidecar | Single-file transformer + separate encoders/VAE |
-| **FP8 storage** | ~50 % | ~50 % | ✅ direct | Any full-precision model (toggle in Model Manager) |
+| **int8** (`int8_convrot`) | ~50 % | ~50 % | ✅ sidecar | Single-file transformer or encoder, stays int8 on every device |
+| **nvfp4** | ~35 % | ~35 % | ✅ sidecar | Single-file transformer or encoder, stays packed on every GPU |
+| **fp8 / fp8_scaled** checkpoint | ~50 % | ~50 % | ✅ sidecar | Single file; stays fp8 with FP8 Storage (on after install) or `fp8_compute` |
+| **FP8 storage** | ~50 % | ~50 % | ✅ sidecar | Full-precision models whose loader supports it ([details](/configuration/optimization/fp8-storage/#where-the-toggle-is-shown)) |
The headline differences:
@@ -111,7 +114,7 @@ The headline differences:
- **SDNQ has the cleanest dynamic-precision story**: GGUF picks one bit-width per file; SDNQ dynamic-mixed exports tune precision per layer.
- **GGUF is more memory-efficient** at the same nominal bit-width because it uses smaller groups. SDNQ trades that for the SVD correction option.
-For low VRAM (~6–8 GB), GGUF Q4 is still the best fit. For 12–16 GB cards that can host a FLUX-class model, SDNQ is the simplest "install one thing, get a working pipeline" option.
+For low VRAM (~6–8 GB), GGUF Q4 is still the best fit for most models; for Z-Image, the NVFP4 and int8 builds fit there too. For 12–16 GB cards that can host a FLUX-class model, SDNQ is the simplest "install one thing, get a working pipeline" option.
## Using a pipeline without standalone components
diff --git a/docs/src/content/docs/contributing/new-model-integration.mdx b/docs/src/content/docs/contributing/new-model-integration.mdx
index 4424f8d7cf..44811bfc1b 100644
--- a/docs/src/content/docs/contributing/new-model-integration.mdx
+++ b/docs/src/content/docs/contributing/new-model-integration.mdx
@@ -287,7 +287,7 @@ Configs identify a model on disk. Every non-abstract subclass of `Config_Base` r
2. **Detection helpers**
- Detect the architecture from keys that only it has, and from shapes where keys are shared. Strip ComfyUI prefixes such as `model.diffusion_model.` first. Exclude LoRA suffixes, so that a LoRA for the architecture is not mistaken for a main model.
+ Detect the architecture from keys that only it has, and from shapes where keys are shared. Strip ComfyUI prefixes such as `model.diffusion_model.` from each key first, with `_strip_comfyui_key_prefix` in `configs/main.py`. It reads the shared `COMFYUI_KEY_PREFIXES`, so detection and the loaders agree on which prefixes exist. Exclude LoRA suffixes, so that a LoRA for the architecture is not mistaken for a main model.
```python title="invokeai/backend/model_manager/configs/main.py"
def _has_new_model_keys(state_dict: dict[str | int, Any]) -> bool:
@@ -377,10 +377,14 @@ Loaders turn a config into an in-memory model. Every module in this folder is im
2. **Single-file and GGUF main models**
Subclass `ModelLoader`, build the transformer under `accelerate.init_empty_weights()`, convert the keys to the diffusers layout, and load with `assign=True`. `Krea2CheckpointModel` and `Krea2GGUFCheckpointModel` in `krea2.py` show the full pattern:
- - reserving RAM before materializing
- - quantized formats: ComfyUI `fp8_scaled`, `int8_convrot` and `nvfp4` (helpers in `invokeai/backend/quantization/`), and GGUF through `gguf_sd_loader`
+ - stripping the ComfyUI prefix with `CheckpointPrefix.detect(sd).strip(sd)` (`invokeai/backend/model_manager/checkpoint_prefix.py`) rather than a hand-written loop
+ - reserving RAM before materializing, exactly once: build the empty model first, take the fp8 and nvfp4 side channels out of the state dict, then reserve, and only then fold or widen anything. A fold before the reservation lands on a cache that was never asked for the room. For fp8, nvfp4 and dense files the reservation is `reserve_for_load` (`invokeai/backend/quantization/load_plan.py`).
+ - quantized formats: ComfyUI `fp8_scaled`, `int8_convrot` and `nvfp4` (helpers in `invokeai/backend/quantization/`), and GGUF through `gguf_sd_loader`. For int8, call `install_int8_convrot_layers` instead of its individual steps. It makes the reservation itself through its `reserve` argument, so do not also call `reserve_for_load`; the steps' order matters, and skipping the first one loads a mixed checkpoint's fp8 weights without their scale.
+ - a loader that handles no quantization side channel (a VAE, an adapter, a non-strict `load_state_dict`) calls `reject_quantized_side_channel` so a quantized file is refused rather than loaded wrongly
- opting into FP8 storage with `_apply_fp8_layerwise_casting`
+ **Declare FP8 Storage support at registration.** The Model Manager only shows the FP8 Storage toggle where `fp8_storage_verdict(base, type, format)` (`invokeai/backend/model_manager/load/fp8_capability.py`) says it works. A loader that does not apply the cast says so where it registers, with a reason: `fp8_storage=Unimplemented("...")` for work not done yet, `NotApplicable("...")` for a deliberate decision. `tests/backend/model_manager/load/test_fp8_capability.py` walks the registry and fails for a loader that neither casts nor declares.
+
Community single-file checkpoints often use key names that differ from diffusers, for example fused projections. Verify the conversion numerically against the diffusers module on a small config.
3. **VAE loader (only for a new VAE)**
@@ -389,13 +393,14 @@ Loaders turn a config into an in-memory model. Every module in this folder is im
4. **Text encoder loader (only for a new encoder type)**
- Register with `base=BaseModelType.Any` and the encoder's `ModelType`, and serve both `SubModelType.TextEncoder` and `SubModelType.Tokenizer`. Vendor tokenizers and configs the loader needs, as `invokeai/backend/qwen2_5_vl/` does, so a single-file install loads without network access.
+ Register with `base=BaseModelType.Any` and the encoder's `ModelType`, and serve both `SubModelType.TextEncoder` and `SubModelType.Tokenizer`. Vendor tokenizers and configs the loader needs, as `invokeai/backend/qwen2_5_vl/` does, so a single-file install loads without network access. Add the vendored files to `[tool.setuptools.package-data]` in `pyproject.toml`, or a wheel install fails with `FileNotFoundError`.
</Steps>
:::tip[Checklist: Model loaders]{icon="approve-check"}
- [ ] Loader per registered `(base, type, format)`
- [ ] Key conversion for single-file and GGUF layouts, verified numerically against diffusers
- [ ] Quantized formats via the existing `invokeai/backend/quantization/` helpers
+- [ ] FP8 Storage: the loader casts, or declares `Unimplemented` / `NotApplicable` at registration
- [ ] VAE and encoder loaders (if new)
:::
diff --git a/docs/src/content/docs/development/Guides/models.mdx b/docs/src/content/docs/development/Guides/models.mdx
deleted file mode 100644
index c6369067d6..0000000000
--- a/docs/src/content/docs/development/Guides/models.mdx
+++ /dev/null
@@ -1,603 +0,0 @@
----
-title: Integrating a New Model Architecture
-description: A comprehensive guide to integrating new foundational model architectures into InvokeAI.
-lastUpdated: 2026-02-19
----
-
-import { Steps, FileTree } from '@astrojs/starlight/components';
-
-This guide walks you through the end-to-end process of integrating a **new foundational model architecture** into InvokeAI. This is required when adding a completely new family of models (e.g., Stable Diffusion 3, FLUX, Hunyuan, etc.), rather than just adding a new checkpoint for an existing architecture.
-
-:::note
-The code examples in this guide use a hypothetical `NewModel` architecture. The implementations of `FLUX`, `SD3`, and `SDXL` in the InvokeAI codebase serve as excellent real-world references.
-:::
-
-## Architectural Overview
-
-Integrating a new model touches several parts of the InvokeAI stack, from the lowest-level PyTorch inference code up to the React frontend:
-
-1. **Taxonomy & Configuration (Backend)**: Declaring the model's existence and defining how to detect it from its weights on disk.
-2. **Model Loading (Backend)**: Defining how to load the detected files into PyTorch models in memory.
-3. **Sampling & Denoising (Backend)**: Implementing the core math for noise generation, scheduling, and the denoising loop.
-4. **Invocations (Backend)**: Wrapping the PyTorch logic into isolated "nodes" that can be executed by InvokeAI's graph engine.
-5. **Graph Building (Frontend)**: Instructing the UI on how to wire these nodes together based on user settings.
-6. **State & UI (Frontend)**: Adding the necessary UI controls and state management for the new model's unique parameters.
-
----
-
-## 1. Taxonomy & Defaults
-
-The first step is to declare your model in the system's taxonomy and provide reasonable default settings.
-
-<Steps>
-1. **Add `BaseModelType`**
-
- Update the base model taxonomy to include your new model.
-
- ```python title="invokeai/backend/model_manager/taxonomy.py" ins={7}
- class BaseModelType(str, Enum):
- # Existing types
- StableDiffusion1 = "sd-1"
- StableDiffusion2 = "sd-2"
- StableDiffusionXL = "sdxl"
- Flux = "flux"
- NewModel = "newmodel"
- ```
-
-2. **Add Variant Type (if needed)**
-
- If your model comes in different structural variants (e.g., different parameter counts or distilled versions like `schnell` vs `dev`), define a variant enum.
-
- ```python title="invokeai/backend/model_manager/taxonomy.py"
- class NewModelVariantType(str, Enum):
- VariantA = "variant_a"
- VariantB = "variant_b"
- ```
-
-3. **Declare the Architecture**
-
- Every `BaseModelType` that is not a sentinel needs a module under
- `invokeai/backend/architectures/defs/`, named after the base value with `-` replaced by `_`. It
- is picked up automatically — there is no import list — but `registry.validate()` runs at boot and
- refuses to start when the file is missing or when it omits a required facet, naming the file.
-
- Default generation parameters live in this declaration, keyed by variant. `None` is the fallback
- for a model whose variant is not listed.
-
- ```python title="invokeai/backend/architectures/defs/newmodel.py"
- register(
- BaseModelType.NewModel,
- ...,
- DefaultSettingsFacet({None: MainModelDefaultSettings(steps=20, cfg_scale=7.0)}),
- )
- ```
-
- `python scripts/new_architecture.py --base newmodel --name NewModel --write` generates this file
- with every required facet present but deliberately wrong, so it fails at boot until each value is
- filled in. It also prints the files it cannot generate, derived from the tree on each run.
-</Steps>
-
-:::tip[Checklist: Taxonomy]{icon="approve-check"}
- - [ ] Extend `BaseModelType` enum in `taxonomy.py`
- - [ ] Create variant enum if needed in `taxonomy.py`
- - [ ] Update `AnyVariant` union in `taxonomy.py`
- - [ ] Create `architectures/defs/<base>.py` with a `register(...)` call — the app will not boot without it
- - [ ] Declare default settings in its `DefaultSettingsFacet`
-:::
-
----
-
-## 2. Model Configs & Detection
-
-InvokeAI needs to know how to identify your model from a `.safetensors` file or a diffusers folder.
-
-<Steps>
-1. **Create Main Model Config**
-
- Define the configuration schemas for your model format(s).
-
- ```python title="invokeai/backend/model_manager/configs/main.py"
- # Checkpoint Format (Single File)
- @ModelConfigFactory.register
- class Main_Checkpoint_NewModel_Config(Checkpoint_Config_Base):
- type: Literal[ModelType.Main] = ModelType.Main
- base: Literal[BaseModelType.NewModel] = BaseModelType.NewModel
- format: Literal[ModelFormat.Checkpoint] = ModelFormat.Checkpoint
- variant: NewModelVariantType = NewModelVariantType.VariantA
-
- @classmethod
- def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict) -> Self:
- if not cls._validate_is_newmodel(mod):
- raise NotAMatchError("Not a NewModel")
- variant = cls._get_variant_or_raise(mod)
- return cls(..., variant=variant)
-
- # Diffusers Format (Folder)
- @ModelConfigFactory.register
- class Main_Diffusers_NewModel_Config(Diffusers_Config_Base):
- type: Literal[ModelType.Main] = ModelType.Main
- base: Literal[BaseModelType.NewModel] = BaseModelType.NewModel
- format: Literal[ModelFormat.Diffusers] = ModelFormat.Diffusers
- ```
-
-2. **Implement Detection Logic**
-
- Write helper functions to inspect the state dictionary keys and shape to uniquely identify your architecture.
-
- ```python title="invokeai/backend/model_manager/configs/main.py"
- def _is_newmodel(state_dict: dict) -> bool:
- """Detect if state dict belongs to NewModel architecture."""
- # Example: check for a highly specific layer name or shape
- required_keys = ["transformer_blocks.0.attn.to_q.weight"]
- return all(key in state_dict for key in required_keys)
-
- def _get_newmodel_variant(state_dict: dict) -> NewModelVariantType:
- """Determine variant from state dict."""
- # Example: distinguish variants based on hidden dimension size
- context_dim = state_dict["context_embedder.weight"].shape[1]
- if context_dim == 7680:
- return NewModelVariantType.VariantA
- return NewModelVariantType.VariantB
- ```
-
-3. **Submodels (VAE & Text Encoder)**
-
- If your model uses a novel VAE or Text Encoder not already in InvokeAI, you must repeat this process to create configs for them (e.g., in `configs/vae.py` and `configs/[encoder_type].py`).
-
-4. **Update the Configuration Union**
-
- Register your new configs so the application knows to check them when scanning directories.
-
- ```python title="invokeai/backend/model_manager/configs/factory.py" ins={4-5}
- AnyModelConfig = Annotated[
- # ... existing configs
- Main_Checkpoint_NewModel_Config |
- Main_Diffusers_NewModel_Config,
- Discriminator(...)
- ]
- ```
-</Steps>
-
-:::tip[Checklist: Configs]{icon="approve-check"}
- - [ ] Create main checkpoint config (`configs/main.py`)
- - [ ] Create main diffusers config (`configs/main.py`)
- - [ ] Create detection helper functions (`_is_newmodel()`, `_get_variant()`)
- - [ ] Create VAE and Text Encoder configs if they use novel architectures
- - [ ] Update `AnyModelConfig` union (`configs/factory.py`)
-:::
-
----
-
-## 3. Model Loaders
-
-Loaders are responsible for converting the files on disk (described by the config) into PyTorch models in memory.
-
-<Steps>
-1. **Create the Model Loader**
-
- ```python title="invokeai/backend/model_manager/load/model_loaders/[newmodel].py"
- @ModelLoaderRegistry.register(
- base=BaseModelType.NewModel,
- type=ModelType.Main,
- format=ModelFormat.Checkpoint
- )
- class NewModelLoader(ModelLoader):
- def _load_model(self, config: AnyModelConfig, submodel_type: SubModelType | None) -> AnyModel:
- # 1. Load the raw weights from disk
- state_dict = self._load_state_dict(config.path)
-
- # 2. Convert state dict keys if necessary (e.g. from original repo format to Diffusers)
- if self._is_original_format(state_dict):
- state_dict = self._convert_to_diffusers_format(state_dict)
-
- # 3. Instantiate the empty PyTorch model
- model = NewModelTransformer(config=model_config)
-
- # 4. Load weights into the model
- model.load_state_dict(state_dict)
- return model
- ```
-
-2. **Custom VAE/Encoder Loaders (If Applicable)**
-
- If you created custom configs for the VAE or Text Encoder, you must also create loaders for them, registering them with the appropriate `ModelType`.
-</Steps>
-
-:::tip[Checklist: Loaders]{icon="approve-check"}
-- [ ] Create and register the main model loader
-- [ ] Create VAE/Encoder loaders if necessary
-- [ ] Implement state dict conversion if supporting non-diffusers formats
-:::
-
----
-
-## 4. Sampling and Denoising Core
-
-This is where the actual mathematical implementation of the model lives.
-
-<Steps>
-
-1. **Sampling Utilities**
-
- Create utility functions specific to how your model handles noise, packing, and scheduling.
-
- ```python title="invokeai/backend/[newmodel]/sampling_utils.py"
- def get_noise_newmodel(num_samples: int, height: int, width: int, seed: int, device: torch.device, dtype: torch.dtype) -> torch.Tensor:
- # Models often have different latent channel counts (e.g., SD1.5 has 4, FLUX has 16)
- latent_channels = 32
- latent_h, latent_w = height // 8, width // 8
- generator = torch.Generator(device=device).manual_seed(seed)
- return torch.randn((num_samples, latent_channels, latent_h, latent_w), generator=generator, device=device, dtype=dtype)
-
- def pack_newmodel(x: torch.Tensor) -> torch.Tensor:
- # Some transformer-based models require packing latents into a sequence
- return rearrange(x, "b c (h ph) (w pw) -> b (h w) (c ph pw)", ph=2, pw=2)
- ```
-
- If the architecture supports external noise, prefer extending the standard
- `invokeai/app/invocations/noise.py` node's `noise_type` selector instead of
- adding a brand new noise node. Only add a dedicated noise invocation when the
- architecture's noise tensor rank or layout cannot be expressed by the
- standard node.
-
-2. **The Denoising Loop**
-
- Implement the core sampling loop. This interacts with schedulers and handles classifier-free guidance (CFG).
-
- ```python title="invokeai/backend/[newmodel]/denoise.py"
- def denoise(model: nn.Module, img: torch.Tensor, txt: torch.Tensor, timesteps: list[float], cfg_scale: list[float], scheduler: Any = None) -> torch.Tensor:
- """Main denoising loop."""
- total_steps = len(timesteps) - 1
-
- for step_index in range(total_steps):
- t_curr = timesteps[step_index]
-
- # Handle CFG (Classifier-Free Guidance)
- if cfg_scale[step_index] > 1.0:
- # Batch positive and negative prompts if applicable
- pred_pos = model(img, t_curr, txt)
- # ...
- else:
- pred = model(img, t_curr, txt)
-
- # Step the scheduler
- img = scheduler.step(pred, t_curr, img).prev_sample
-
- return img
- ```
-
-3. **Schedulers**
-
- If your model requires a novel scheduler, add it to the scheduler mapping (e.g., `invokeai/backend/[newmodel]/schedulers.py`).
-</Steps>
-
-:::tip[Checklist: Core Inference]{icon="approve-check"}
- - [ ] Noise generation (`get_noise_newmodel()`)
- - [ ] Pack/unpack functions (if transformer-based)
- - [ ] Timestep schedule generation
- - [ ] Denoise loop implementation
- - [ ] Map supported schedulers
-:::
-
----
-
-## 5. Invocations
-
-Invocations expose your PyTorch functions as isolated execution nodes in InvokeAI's graph.
-
-:::note[Where node files go]
-Node modules live in `invokeai/app/invocations/[newmodel]/`, one package per architecture. Three
-kinds of node are grouped by role instead, because they are shared across architectures rather than
-owned by one: VAE nodes go in `invocations/vae/`, text encoders in `invocations/text_encoder/`, and
-PiD decode/upscale in `invocations/pid/`. Generic nodes — noise, primitives, image ops, metadata —
-stay at the top level.
-
-Keep the architecture prefix on the filename (`newmodel_denoise.py`) even inside `newmodel/`. The
-package is discovered automatically, but it needs an `__init__.py`: a directory without one is not
-a package, and every node in it would simply not exist at runtime.
-:::
-
-<Steps>
-1. **Model Loader Invocation**
-
- Loads the components (Transformer, VAE, etc.) and provides them to downstream nodes.
-
- ```python title="invokeai/app/invocations/[newmodel]/[newmodel]_model_loader.py"
- @invocation("newmodel_model_loader", title="NewModel Loader", category="model_loader")
- class NewModelModelLoaderInvocation(BaseInvocation):
- model: ModelIdentifierField = InputField(description="Main model")
-
- def invoke(self, context: InvocationContext) -> NewModelLoaderOutput:
- transformer = self.model.model_copy(update={"submodel_type": SubModelType.Transformer})
- vae = self.model.model_copy(update={"submodel_type": SubModelType.VAE})
- return NewModelLoaderOutput(transformer=transformer, vae=vae)
- ```
-
-2. **Text Encoder Invocation**
-
- Tokenizes the prompt and runs the text encoder(s).
-
- ```python title="invokeai/app/invocations/text_encoder/[newmodel]_text_encoder.py"
- @invocation("newmodel_text_encode", title="NewModel Text Encoder", category="conditioning")
- class NewModelTextEncoderInvocation(BaseInvocation):
- prompt: str = InputField()
- encoder: EncoderField = InputField()
-
- def invoke(self, context: InvocationContext) -> ConditioningOutput:
- # 1. Tokenize prompt
- # 2. Run encoder to get embeddings
- # 3. Save to context and return
- conditioning_name = context.conditioning.save(ConditioningFieldData(...))
- return ConditioningOutput(conditioning=ConditioningField(conditioning_name=conditioning_name))
- ```
-
-3. **Denoise Invocation**
-
- Wraps the `denoise` loop you wrote in the previous section.
-
- ```python title="invokeai/app/invocations/[newmodel]/[newmodel]_denoise.py"
- @invocation("newmodel_denoise", title="NewModel Denoise", category="latents")
- class NewModelDenoiseInvocation(BaseInvocation):
- latents: LatentsField | None = InputField(default=None)
- noise: LatentsField | None = InputField(default=None)
- positive_conditioning: ConditioningField = InputField()
- transformer: TransformerField = InputField()
- steps: int = InputField(default=20)
- cfg_scale: float = InputField(default=7.0)
-
- def invoke(self, context: InvocationContext) -> LatentsOutput:
- # Generate noise, get schedule, and call your denoise() function
- pass
- ```
-
- If you add external noise support, keep it optional so seed-driven workflows
- continue to work. Validate connected noise against the architecture's
- expected shape before using it.
-
-4. **VAE Encode / Decode Invocations**
-
- Create nodes to transition between pixel space (images) and latent space.
-</Steps>
-
-:::tip[Checklist: Invocations]{icon="approve-check"}
- - [ ] Define output classes (e.g., `NewModelLoaderOutput`)
- - [ ] Model loader invocation (`[newmodel]/[newmodel]_model_loader.py`)
- - [ ] Text encoder invocation (`text_encoder/[newmodel]_text_encoder.py`)
- - [ ] Denoise invocation (`[newmodel]/[newmodel]_denoise.py`)
- - [ ] Extend the standard `noise` invocation if the architecture supports external noise
- - [ ] VAE encode/decode invocations (`vae/[newmodel]_vae_encode.py`, `vae/[newmodel]_vae_decode.py`)
- - [ ] `__init__.py` in `invocations/[newmodel]/`, or none of its nodes are discovered
-:::
-
----
-
-## 6. Frontend: Graph Building
-
-The UI doesn't know about Python functions; it only knows how to build graphs of Invocations.
-
-<Steps>
-1. **Create the Graph Builder**
-
- Write a TypeScript function that constructs the node graph for your model.
-
- ```typescript title="invokeai/frontend/webv1/src/features/nodes/util/graph/generation/buildNewModelGraph.ts"
- export const buildNewModelGraph = async (arg: GraphBuilderArg): Promise<GraphBuilderResult> => {
- const { state, manager } = arg;
- const { model } = state.params;
- const g = new Graph();
-
- // 1. Add Loader
- const modelLoader = g.addNode({
- id: NEWMODEL_MODEL_LOADER,
- type: 'newmodel_model_loader',
- model: Graph.getModelMetadataField(model),
- });
-
- // 2. Add Text Encoders
- const positivePrompt = g.addNode({
- id: POSITIVE_CONDITIONING,
- type: 'newmodel_text_encode',
- prompt: state.params.positivePrompt,
- });
- g.addEdge(modelLoader, 'encoder', positivePrompt, 'encoder');
-
- // 3. Add Denoise
- const denoise = g.addNode({
- id: NEWMODEL_DENOISE,
- type: 'newmodel_denoise',
- steps: state.params.steps,
- cfg_scale: state.params.cfg,
- });
- g.addEdge(modelLoader, 'transformer', denoise, 'transformer');
- g.addEdge(positivePrompt, 'conditioning', denoise, 'positive_conditioning');
-
- // 4. Add VAE Decode
- const l2i = g.addNode({
- id: NEWMODEL_VAE_DECODE,
- type: 'newmodel_vae_decode',
- });
- g.addEdge(modelLoader, 'vae', l2i, 'vae');
- g.addEdge(denoise, 'latents', l2i, 'latents');
-
- return { g, denoise, posCond: positivePrompt };
- };
- ```
-
-2. **Register the Graph Builder**
-
- Hook your graph builder into the main routing logic.
-
- ```typescript title="invokeai/frontend/webv1/src/features/queue/hooks/useEnqueueCanvas.ts" ins={5-6}
- switch (base) {
- case 'sdxl':
- return buildSDXLGraph(arg);
- case 'flux':
- return buildFLUXGraph(arg);
- case 'newmodel':
- return buildNewModelGraph(arg);
- }
- ```
-
-3. **Update Type Definitions**
-
- Add your new nodes to the strict frontend type unions.
-
- ```typescript title="invokeai/frontend/webv1/src/features/nodes/util/graph/types.ts" ins="| 'newmodel_vae_decode'"
- export type ImageOutputNodes =
- | 'l2i' | 'flux_vae_decode' | 'sd3_l2i' | 'newmodel_vae_decode';
- ```
-
-4. **Generation Modes**
-
- Update `invokeai/app/invocations/metadata.py` to include your new modes in `GENERATION_MODES` (e.g., `"newmodel_txt2img"`, `"newmodel_img2img"`).
-</Steps>
-
-:::tip[Checklist: Graph Building]{icon="approve-check"}
- - [ ] Create graph builder (`buildNewModelGraph.ts`)
- - [ ] Register graph builder in `useEnqueueCanvas.ts`
- - [ ] Update node unions in `types.ts`
- - [ ] Add generation modes to python `metadata.py`
-:::
-
----
-
-## 7. Frontend: State & UI
-
-Finally, add any custom UI controls (like a specific scheduler dropdown) and manage their state.
-
-<Steps>
-1. **Add to Redux State**
-
- Update the parameters slice for your model-specific settings.
-
- ```typescript title="invokeai/frontend/webv1/src/features/controlLayers/store/paramsSlice.ts"
- interface ParamsState {
- // ...
- newmodelScheduler: 'euler' | 'heun';
- }
-
- const initialState: ParamsState = {
- // ...
- newmodelScheduler: 'euler',
- };
-
- // Add reducers and export selectors...
- ```
-
-2. **Parameter Recall**
-
- Ensure users can extract parameters from previously generated images by updating `invokeai/frontend/webv1/src/features/metadata/parsing.tsx`.
-
- ```typescript title="invokeai/frontend/webv1/src/features/metadata/parsing.tsx"
- const recallNewmodelScheduler = (metadata: CoreMetadata) => {
- if (metadata.scheduler) {
- dispatch(setNewmodelScheduler(metadata.scheduler));
- }
- };
- ```
-</Steps>
-
-:::tip[Checklist: State & UI]{icon="approve-check"}
- - [ ] Extend state interface for model-specific parameters
- - [ ] Create reducers and selectors
- - [ ] Add parameter recall handlers in `parsing.tsx`
-:::
-
----
-
-## 8. Optional Features
-
-Depending on the model, you may want to support additional features.
-
-### ControlNet Support
-Requires backend configuration (`configs/controlnet.py`), a custom invocation (`[newmodel]/[newmodel]_controlnet.py`), and frontend graph integration (`addControlNets`).
-
-### LoRA Support
-Requires defining a LoRA config (`configs/lora.py`), updating the model loader to pass LoRA fields, and wiring `addLoRAs` in the frontend graph builder.
-
-### IP-Adapter
-Requires a custom invocation for image prompting (`[newmodel]/[newmodel]_ip_adapter.py`) and frontend integration via `addIPAdapters`.
-
----
-
-## 9. Starter Models
-
-To allow users to easily download your model from the Model Manager UI, add it to the starter models catalogue.
-
-The catalogue is a package: define the models in your own module, then list them in the package's
-`__init__.py`.
-
-```python title="invokeai/backend/model_manager/starter_models/[newmodel].py"
-from invokeai.backend.model_manager.starter_models.types import StarterModel
-
-newmodel_main = StarterModel(
- name="NewModel Main",
- base=BaseModelType.NewModel,
- source="organization/newmodel-main", # HuggingFace repo
- description="NewModel main transformer.",
- type=ModelType.Main,
-)
-```
-
-`STARTER_MODELS` is a curated order — it is what the install dialog shows, in the sequence someone
-chose — so insert where the model belongs rather than appending.
-
-```python title="invokeai/backend/model_manager/starter_models/__init__.py"
-from invokeai.backend.model_manager.starter_models.newmodel import newmodel_main
-
-STARTER_MODELS: list[StarterModel] = [
- # ... existing models
- newmodel_main,
-]
-```
-
-:::tip[Checklist: Starter Models]{icon="approve-check"}
-- [ ] Create `starter_models/[newmodel].py`
-- [ ] Define main model StarterModel
-- [ ] Define VAE/Encoder StarterModels if separate — shared ones live in `starter_models/common.py`
-- [ ] Set dependencies correctly if required
-- [ ] Import and place them in `STARTER_MODELS` in `starter_models/__init__.py`
-:::
-
----
-
-## Summary of Integration Files
-
-A complete minimal `txt2img` integration touches the following areas:
-
-<FileTree>
-- invokeai
- - app/invocations
- - metadata.py
- - `[newmodel]`
- - `__init__.py` required, or none of this package's nodes are discovered
- - `[newmodel]_model_loader.py`
- - `[newmodel]_denoise.py`
- - text_encoder
- - `[newmodel]_text_encoder.py`
- - vae
- - `[newmodel]_vae_decode.py`
- - backend
- - architectures/defs
- - `[newmodel].py` the architecture's declaration; the app refuses to boot without it
- - model_manager
- - taxonomy.py
- - configs
- - main.py
- - factory.py
- - load/model_loaders
- - `[newmodel].py`
- - starter_models
- - `[newmodel].py`
- - `__init__.py` import the models here and place them in `STARTER_MODELS`
- - `[newmodel]`
- - sampling_utils.py
- - denoise.py
- - frontend/webv1/src/features
- - nodes/util/graph
- - generation/buildNewModelGraph.ts
- - types.ts
- - queue/hooks/useEnqueueCanvas.ts
- - controlLayers/store/paramsSlice.ts
- - metadata/parsing.tsx
-</FileTree>
diff --git a/docs/src/content/docs/development/index.mdx b/docs/src/content/docs/development/index.mdx
index 77e362bc10..f219912263 100644
--- a/docs/src/content/docs/development/index.mdx
+++ b/docs/src/content/docs/development/index.mdx
@@ -25,9 +25,9 @@ This section of the documentation is for developers interested in contributing t
</LinkButton>
</Card>
<Card title="Guides" icon="open-book">
- A collection of guides for common development tasks, such as adding new model architectures, making tests, and more.
+ A collection of guides for common development tasks, such as creating nodes, writing tests, and more. Adding a new model architecture is covered in the [new model integration guide](/contributing/new-model-integration/).
- <LinkButton href="./guides/models" icon="right-arrow" variant="secondary">
+ <LinkButton href="./guides/creating-nodes/" icon="right-arrow" variant="secondary">
Learn more
</LinkButton>
</Card>
diff --git a/docs/src/content/docs/start-here/system-requirements.mdx b/docs/src/content/docs/start-here/system-requirements.mdx
index ede60e15bb..89663c79d8 100644
--- a/docs/src/content/docs/start-here/system-requirements.mdx
+++ b/docs/src/content/docs/start-here/system-requirements.mdx
@@ -28,9 +28,11 @@ The requirements below are rough guidelines for best performance. GPUs with less
| SDXL | 1024x1024 | Nvidia 20xx+ | 8GB | 16GB | |
| FLUX.1 | 1024x1024 | Nvidia 20xx+ | 10GB | 32GB | Download totals: NF4 ~12GB, int8 ~18GB, bf16 ~33GB. The int8 transformer is 11.5GB resident on any supported GPU, so it streams on a 10GB card |
| FLUX.2 Klein 4B | 1024x1024 | Nvidia 30xx+ | 12GB | 16GB | FP8 works with 8GB+; Diffusers + encoder |
-| FLUX.2 Klein 9B | 1024x1024 | Nvidia 30xx+ | 12GB | 32GB | int8 9.5GB on any supported GPU; FP8 needs a 40xx **and** `fp8_compute` (off by default) to stay that small, else ~18GB. The Qwen3 8B encoder is 15GB and streams on a 12GB card |
-| Z-Image Turbo | 1024x1024 | Nvidia 20xx+ | 8GB | 16GB | Q4_K / NVFP4 8GB; Q8/BF16 16GB+ |
-| Krea-2 (Turbo / Raw) | 1024x1024 | Nvidia 40xx | 24GB | 32GB | FP8 works with 16GB+; GGUF Q4_K ~12GB. Diffusers ~26GB; GGUF needs a standalone VAE + Qwen3-VL encoder |
+| FLUX.2 Klein 9B | 1024x1024 | Nvidia 30xx+ | 12GB | 32GB | int8 transformer ~9.5GB on any supported GPU; FP8 checkpoints stay about as small with FP8 Storage, which installation switches on. The Qwen3 8B encoder is 15GB (int8 7.6GB) and streams on a 12GB card |
+| Z-Image Turbo | 1024x1024 | Nvidia 20xx+ | 8GB | 16GB | Q4_K / NVFP4 / int8 8GB (int8 ~6GB resident); Q8/BF16 16GB+ |
+| Krea-2 (Turbo / Raw) | 1024x1024 | Nvidia 40xx | 24GB | 32GB | FP8 works with 16GB+; NVFP4 or GGUF Q4_K transformer ~7GB, plus the Qwen3-VL encoder (8.5GB bf16, ~2.8GB as GGUF Q4_K), int8 transformer 12.6GB. Diffusers ~26GB; single files need a standalone VAE + Qwen3-VL encoder (GGUF encoder ~2.8GB) |
+| Ideogram 4 | 1024x1024 | Nvidia 30xx+ | 24GB | 32GB | Two transformers resident at once. nf4 build fits 24GB (CUDA only); single-file fp8 or int8 pair ~17.5GB plus the Qwen3-VL 8B encoder. See [Ideogram 4](/users-guide/models/introduction/#ideogram-4) |
+| ERNIE-Image | 1024x1024 | Nvidia 40xx | 24GB | 32GB | Single-file transformer ~16GB plus the Ministral 3B encoder ~7.7GB |
| Wan 2.2 A14B (T2V/I2V) | 1280x720 | Nvidia 30xx+ | 12GB | 32GB | Dual-expert MoE; Q4_K_M 12GB; Q8 18GB+; Diffusers requires 32GB+ |
| Wan 2.2 TI2V-5B | 1280x720 | Nvidia 20xx+ | 8GB | 16GB | Single transformer; Q4_K_M 6GB+; Q8 8GB+; Diffusers 12GB+ |
diff --git a/docs/src/generated/settings.json b/docs/src/generated/settings.json
index f23aaf9fc2..e7412b3d05 100644
--- a/docs/src/generated/settings.json
+++ b/docs/src/generated/settings.json
@@ -529,7 +529,7 @@
{
"category": "CACHE",
"default": false,
- "description": "Keep ComfyUI 'scaled fp8' checkpoints quantized instead of dequantizing them at load, and run their matmuls on the fp8 tensor cores (requires an Ada/SM 8.9 or newer NVIDIA GPU; falls back automatically otherwise). Roughly halves the transformer's VRAM and speeds up denoising, but quantizes activations as well, so images will differ from previous versions at the same seed. Reproducibility also requires the model to be FULLY resident in VRAM: a layer whose weights are still in RAM falls back to the dequantized path, and since which layers are resident shifts from run to run, the same seed then yields visibly different images. For repeatable output, ensure the model loads at 100% (e.g. enable_partial_loading=false with enough free VRAM).",
+ "description": "Keep ComfyUI 'scaled fp8' checkpoints quantized instead of dequantizing them at load, and run their matmuls on the fp8 tensor cores (requires an Ada/SM 8.9 or newer NVIDIA GPU, or a ROCm GPU that passes an fp8 matmul probe; falls back automatically otherwise). Speeds up denoising and keeps the transformer at fp8 size - FP8 Storage alone also keeps it at that size, without the speedup - but quantizes activations as well, so images will differ from previous versions at the same seed. Reproducibility also requires the model to be FULLY resident in VRAM: a layer whose weights are still in RAM falls back to the dequantized path, and since which layers are resident shifts from run to run, the same seed then yields visibly different images. For repeatable output, ensure the model loads at 100% (e.g. enable_partial_loading=false with enough free VRAM).",
"env_var": "INVOKEAI_FP8_COMPUTE",
"literal_values": [],
"name": "fp8_compute",
@@ -717,7 +717,7 @@
{
"category": "GENERATION",
"default": false,
- "description": "Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty). A tiled decode is not pixel-identical to a single-pass one: a VAE decoder normalises and attends over the whole image, so the difference is spread across it rather than confined to the tile seams. As of this release the setting also applies to FLUX.1, which previously ignored it.",
+ "description": "Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty). A tiled decode is not pixel-identical to a single-pass one: a VAE decoder normalises and attends over the whole image, so the difference is spread across it rather than confined to the tile seams. Also tiles the encode. Read by the SD1.5/SDXL, FLUX.1, Z-Image and Qwen-Image VAE nodes, the Anima encode and the Krea-2 style reference; other model families ignore it.",
"env_var": "INVOKEAI_FORCE_TILED_DECODE",
"literal_values": [],
"name": "force_tiled_decode",
diff --git a/invokeai/app/services/config/config_default.py b/invokeai/app/services/config/config_default.py
index f4640c3653..39483cc31a 100644
--- a/invokeai/app/services/config/config_default.py
+++ b/invokeai/app/services/config/config_default.py
@@ -111,7 +111,7 @@ class InvokeAIAppConfig(BaseSettings):
device_working_mem_gb: The amount of working memory to keep available on the compute device (in GB). Has no effect if running on CPU. If you are experiencing OOM errors, try increasing this value.
enable_partial_loading: Enable partial loading of models. This enables models to run with reduced VRAM requirements (at the cost of slower speed) by streaming the model from RAM to VRAM as its used. In some edge cases, partial loading can cause models to run more slowly if they were previously being fully loaded into VRAM.
keep_ram_copy_of_weights: Whether to keep a full RAM copy of a model's weights when the model is loaded in VRAM. Keeping a RAM copy increases average RAM usage, but speeds up model switching and LoRA patching (assuming there is sufficient RAM). Set this to False if RAM pressure is consistently high.
- fp8_compute: Keep ComfyUI 'scaled fp8' checkpoints quantized instead of dequantizing them at load, and run their matmuls on the fp8 tensor cores (requires an Ada/SM 8.9 or newer NVIDIA GPU; falls back automatically otherwise). Roughly halves the transformer's VRAM and speeds up denoising, but quantizes activations as well, so images will differ from previous versions at the same seed. Reproducibility also requires the model to be FULLY resident in VRAM: a layer whose weights are still in RAM falls back to the dequantized path, and since which layers are resident shifts from run to run, the same seed then yields visibly different images. For repeatable output, ensure the model loads at 100% (e.g. enable_partial_loading=false with enough free VRAM).
+ fp8_compute: Keep ComfyUI 'scaled fp8' checkpoints quantized instead of dequantizing them at load, and run their matmuls on the fp8 tensor cores (requires an Ada/SM 8.9 or newer NVIDIA GPU, or a ROCm GPU that passes an fp8 matmul probe; falls back automatically otherwise). Speeds up denoising and keeps the transformer at fp8 size - FP8 Storage alone also keeps it at that size, without the speedup - but quantizes activations as well, so images will differ from previous versions at the same seed. Reproducibility also requires the model to be FULLY resident in VRAM: a layer whose weights are still in RAM falls back to the dequantized path, and since which layers are resident shifts from run to run, the same seed then yields visibly different images. For repeatable output, ensure the model loads at 100% (e.g. enable_partial_loading=false with enough free VRAM).
fp8_compute_full_precision_hints: Honor the per-layer 'full_precision_matrix_mult' flags that some scaled-fp8 checkpoints ship. Those layers then dequantize on every forward instead of using the fp8 tensor cores, which can cost a large part of the fp8_compute speedup - on checkpoints that mark many layers, most of it. Set to false to run every quantized layer on the fp8 tensor cores, ignoring the producer's instruction; faster, but the marked layers were flagged as numerically sensitive, so quality may suffer. Only has an effect when fp8_compute is enabled.
ram: DEPRECATED: This setting is no longer used. It has been replaced by `max_cache_ram_gb`, but most users will not need to use this config since automatic cache size limits should work well in most cases. This config setting will be removed once the new model cache behavior is stable.
vram: DEPRECATED: This setting is no longer used. It has been replaced by `max_cache_vram_gb`, but most users will not need to use this config since automatic cache size limits should work well in most cases. This config setting will be removed once the new model cache behavior is stable.
@@ -124,7 +124,7 @@ class InvokeAIAppConfig(BaseSettings):
pid_memory_optimization: Enable experimental PiD decode memory optimizations. Roughly halves the peak activation memory of a PiD decode; in exchange the decoded image changes slightly, because neither the chunked pixel pathway nor the float32 sampler intermediates are bit-exact with the default path.
attention_type: Attention type.<br>Valid values: `auto`, `normal`, `xformers`, `sliced`, `torch-sdp`
attention_slice_size: Slice size, valid when attention_type=="sliced".<br>Valid values: `auto`, `balanced`, `max`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`
- force_tiled_decode: Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty). A tiled decode is not pixel-identical to a single-pass one: a VAE decoder normalises and attends over the whole image, so the difference is spread across it rather than confined to the tile seams. As of this release the setting also applies to FLUX.1, which previously ignored it.
+ force_tiled_decode: Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty). A tiled decode is not pixel-identical to a single-pass one: a VAE decoder normalises and attends over the whole image, so the difference is spread across it rather than confined to the tile seams. Also tiles the encode. Read by the SD1.5/SDXL, FLUX.1, Z-Image and Qwen-Image VAE nodes, the Anima encode and the Krea-2 style reference; other model families ignore it.
pil_compress_level: The compress_level setting of PIL.Image.save(), used for PNG encoding. All settings are lossless. 0 = no compression, 1 = fastest with slightly larger filesize, 9 = slowest with smallest filesize. 1 is typically the best setting.
max_queue_size: Maximum number of items in the session queue.
session_queue_mode: Session queue mode. Use 'FIFO' for traditional first-in-first-out, or 'round_robin' to serve each user's jobs in turn. In single-user mode, FIFO is always used regardless of this setting.<br>Valid values: `FIFO`, `round_robin`
@@ -226,7 +226,7 @@ class InvokeAIAppConfig(BaseSettings):
device_working_mem_gb: float = Field(default=3, description="The amount of working memory to keep available on the compute device (in GB). Has no effect if running on CPU. If you are experiencing OOM errors, try increasing this value.")
enable_partial_loading: bool = Field(default=True, description="Enable partial loading of models. This enables models to run with reduced VRAM requirements (at the cost of slower speed) by streaming the model from RAM to VRAM as its used. In some edge cases, partial loading can cause models to run more slowly if they were previously being fully loaded into VRAM.")
keep_ram_copy_of_weights: bool = Field(default=True, description="Whether to keep a full RAM copy of a model's weights when the model is loaded in VRAM. Keeping a RAM copy increases average RAM usage, but speeds up model switching and LoRA patching (assuming there is sufficient RAM). Set this to False if RAM pressure is consistently high.")
- fp8_compute: bool = Field(default=False, description="Keep ComfyUI 'scaled fp8' checkpoints quantized instead of dequantizing them at load, and run their matmuls on the fp8 tensor cores (requires an Ada/SM 8.9 or newer NVIDIA GPU; falls back automatically otherwise). Roughly halves the transformer's VRAM and speeds up denoising, but quantizes activations as well, so images will differ from previous versions at the same seed. Reproducibility also requires the model to be FULLY resident in VRAM: a layer whose weights are still in RAM falls back to the dequantized path, and since which layers are resident shifts from run to run, the same seed then yields visibly different images. For repeatable output, ensure the model loads at 100% (e.g. enable_partial_loading=false with enough free VRAM).")
+ fp8_compute: bool = Field(default=False, description="Keep ComfyUI 'scaled fp8' checkpoints quantized instead of dequantizing them at load, and run their matmuls on the fp8 tensor cores (requires an Ada/SM 8.9 or newer NVIDIA GPU, or a ROCm GPU that passes an fp8 matmul probe; falls back automatically otherwise). Speeds up denoising and keeps the transformer at fp8 size - FP8 Storage alone also keeps it at that size, without the speedup - but quantizes activations as well, so images will differ from previous versions at the same seed. Reproducibility also requires the model to be FULLY resident in VRAM: a layer whose weights are still in RAM falls back to the dequantized path, and since which layers are resident shifts from run to run, the same seed then yields visibly different images. For repeatable output, ensure the model loads at 100% (e.g. enable_partial_loading=false with enough free VRAM).")
fp8_compute_full_precision_hints: bool = Field(default=True, description="Honor the per-layer 'full_precision_matrix_mult' flags that some scaled-fp8 checkpoints ship. Those layers then dequantize on every forward instead of using the fp8 tensor cores, which can cost a large part of the fp8_compute speedup - on checkpoints that mark many layers, most of it. Set to false to run every quantized layer on the fp8 tensor cores, ignoring the producer's instruction; faster, but the marked layers were flagged as numerically sensitive, so quality may suffer. Only has an effect when fp8_compute is enabled.")
# Deprecated CACHE configs
ram: Optional[float] = Field(default=None, gt=0, description="DEPRECATED: This setting is no longer used. It has been replaced by `max_cache_ram_gb`, but most users will not need to use this config since automatic cache size limits should work well in most cases. This config setting will be removed once the new model cache behavior is stable.")
@@ -248,7 +248,7 @@ class InvokeAIAppConfig(BaseSettings):
pid_memory_optimization: bool = Field(default=False, description="Enable experimental PiD decode memory optimizations. Roughly halves the peak activation memory of a PiD decode; in exchange the decoded image changes slightly, because neither the chunked pixel pathway nor the float32 sampler intermediates are bit-exact with the default path.")
attention_type: ATTENTION_TYPE = Field(default="auto", description="Attention type.")
attention_slice_size: ATTENTION_SLICE_SIZE = Field(default="auto", description='Slice size, valid when attention_type=="sliced".')
- force_tiled_decode: bool = Field(default=False, description="Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty). A tiled decode is not pixel-identical to a single-pass one: a VAE decoder normalises and attends over the whole image, so the difference is spread across it rather than confined to the tile seams. As of this release the setting also applies to FLUX.1, which previously ignored it.")
+ force_tiled_decode: bool = Field(default=False, description="Whether to enable tiled VAE decode (reduces memory consumption with some performance penalty). A tiled decode is not pixel-identical to a single-pass one: a VAE decoder normalises and attends over the whole image, so the difference is spread across it rather than confined to the tile seams. Also tiles the encode. Read by the SD1.5/SDXL, FLUX.1, Z-Image and Qwen-Image VAE nodes, the Anima encode and the Krea-2 style reference; other model families ignore it.")
pil_compress_level: int = Field(default=1, description="The compress_level setting of PIL.Image.save(), used for PNG encoding. All settings are lossless. 0 = no compression, 1 = fastest with slightly larger filesize, 9 = slowest with smallest filesize. 1 is typically the best setting.")
max_queue_size: int = Field(default=10000, gt=0, description="Maximum number of items in the session queue.")
session_queue_mode: SESSION_QUEUE_MODE = Field(default="round_robin", description="Session queue mode. Use 'FIFO' for strict first-in-first-out, or 'round_robin' to serve each user's jobs in turn. In round-robin mode, priority orders each user's own jobs, but the user rotation takes precedence: one user's high-priority job does not preempt another user's turn. In single-user mode, jobs are served in submission order either way — except that on multi-GPU systems the default 'round_robin' allows same-priority jobs to be reordered slightly so a freed GPU prefers jobs whose models it already has loaded. Set 'FIFO' to disable that reordering and enforce strict submission order.")