Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
6ef2cb9
feat(e2e): add per-family end-to-end regression runner
Pfannkuchensack Oct 17, 2026
855ebe2
feat(working-memory): ship VAE working-memory coefficients as data
Pfannkuchensack Oct 17, 2026
92c293e
Merge branch 'main' into feat/family-e2e
Pfannkuchensack Oct 17, 2026
2f8d0c2
fix(e2e): snapshot the template database through the database layer
Pfannkuchensack Oct 17, 2026
4c98e3c
Merge remote-tracking branch 'origin/feat/family-e2e' into feat/famil…
Pfannkuchensack Oct 17, 2026
470db71
feat(working-memory): measure working memory in admin calibration runs
Pfannkuchensack Oct 17, 2026
ef1bbec
fix(working-memory): reserve VAE working memory per dtype and allocator
Pfannkuchensack Oct 17, 2026
f5859cc
Merge commit '470db713f5' into feat/family-e2e-calibration
Pfannkuchensack Oct 17, 2026
bf8254f
Merge commit 'ef1bbec220' into feat/family-e2e-calibration
Pfannkuchensack Oct 17, 2026
0fd56fe
fix(working-memory): fit VAE lines against the highest reading per size
Pfannkuchensack Oct 17, 2026
6f0544d
Merge commit '0fd56fe092' into feat/family-e2e-calibration
Pfannkuchensack Oct 17, 2026
fab1519
fix(working-memory): record the operating system as a hard calibratio…
Pfannkuchensack Oct 17, 2026
7a75080
feat(e2e): calibrate working memory and build shipped data from probe…
Pfannkuchensack Oct 17, 2026
8d0b78d
Merge commit 'fab1519974' into feat/family-e2e-calibration
Pfannkuchensack Oct 17, 2026
9267c3e
test(working-memory): probe points that would tilt a line do not choo…
Pfannkuchensack Oct 17, 2026
87079a6
feat(models): calibrate VAE working memory per model from the Model M…
Pfannkuchensack Oct 18, 2026
cb91aab
fix(models): keep fragmented and partly resident windows out of user …
Pfannkuchensack Oct 18, 2026
83e3639
Merge branch 'main' into feat/working-memory-estimates
Pfannkuchensack Oct 18, 2026
8946969
Merge branch 'main' into feat/working-memory-calibration-runs
Pfannkuchensack Oct 18, 2026
6fa6a2c
Merge branch 'main' into fix/vae-working-memory-dtype
Pfannkuchensack Oct 18, 2026
ea06b4f
Merge branch 'fix/vae-working-memory-dtype' into feat/family-e2e-cali…
Pfannkuchensack Oct 18, 2026
d1452cf
Merge branch 'feat/working-memory-calibration-runs' into feat/family-…
Pfannkuchensack Oct 18, 2026
7511489
fix(e2e): set the new project settings in exported graphs
Pfannkuchensack Oct 18, 2026
ed43bd9
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 18, 2026
e3c4b92
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 18, 2026
7714be8
chore(perf): record the working-memory locale growth in the route byt…
Pfannkuchensack Oct 18, 2026
46b0f75
feat(models): move working memory to a collapsed section at the end o…
Pfannkuchensack Oct 18, 2026
727cbbd
Merge branch 'main' into feat/family-e2e
Pfannkuchensack Oct 18, 2026
0d96e0a
fix(e2e): set the new project settings in exported graphs
Pfannkuchensack Oct 18, 2026
f11f602
feat(working-memory): reserve Z-Image denoise working memory from mea…
Pfannkuchensack Oct 18, 2026
f0349da
docs(working-memory): name the in-server checks of the Z-Image denois…
Pfannkuchensack Oct 18, 2026
d8b0fc5
Merge branch 'main' into feat/working-memory-calibration-runs
Pfannkuchensack Oct 18, 2026
9f5187a
Merge branch 'main' into fix/vae-working-memory-dtype
Pfannkuchensack Oct 18, 2026
cb6cd56
Merge branch 'fix/vae-working-memory-dtype' into feat/family-e2e-cali…
Pfannkuchensack Oct 18, 2026
4ca9c52
Merge branch 'feat/working-memory-calibration-runs' into feat/family-…
Pfannkuchensack Oct 18, 2026
52dfe1f
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 18, 2026
0969d4e
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 18, 2026
4ba43cd
feat(working-memory): reserve FLUX.2 denoise working memory from meas…
Pfannkuchensack Oct 18, 2026
1f824b6
Merge branch 'main' into feat/working-memory-calibration-runs
Pfannkuchensack Oct 19, 2026
2f62211
Merge branch 'feat/working-memory-calibration-runs' into feat/family-…
Pfannkuchensack Oct 19, 2026
fca8919
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 19, 2026
084741a
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 19, 2026
c224010
Merge branch 'feat/working-memory-denoise' into feat/working-memory-f…
Pfannkuchensack Oct 19, 2026
8d0a855
chore(perf): record the working-memory locale growth in the route byt…
Pfannkuchensack Oct 19, 2026
f908b84
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 19, 2026
f9f3a6a
Merge branch 'feat/working-memory-denoise' into feat/working-memory-f…
Pfannkuchensack Oct 19, 2026
f004b1a
test(working-memory): script the allocator backend in the fingerprint…
Pfannkuchensack Oct 19, 2026
31350ae
test(working-memory): script the allocator backend where a test build…
Pfannkuchensack Oct 19, 2026
9e5bd46
Merge branch 'feat/working-memory-data' into feat/family-e2e-calibration
Pfannkuchensack Oct 19, 2026
65636a7
fix(working-memory): import the VAE facet through the architectures p…
Pfannkuchensack Oct 19, 2026
4c4c258
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 19, 2026
1f53cb9
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 19, 2026
d352d00
Merge branch 'feat/working-memory-denoise' into feat/working-memory-f…
Pfannkuchensack Oct 19, 2026
7e0c7a2
Merge remote-tracking branch 'upstream/main' into feat/working-memory…
Pfannkuchensack Oct 19, 2026
89dae23
test(upscale): stop the FLUX.2 entry test where the node prices its w…
Pfannkuchensack Oct 19, 2026
ee3ef93
Merge branch 'main' into feat/working-memory-calibration-runs
Pfannkuchensack Oct 20, 2026
0cf2fee
Merge branch 'main' into fix/vae-working-memory-dtype
Pfannkuchensack Oct 20, 2026
3ebdb7f
fix(working-memory): keep calibration runs and their measurements tru…
Pfannkuchensack Oct 20, 2026
4fbf583
Merge remote-tracking branch 'origin/feat/working-memory-calibration-…
Pfannkuchensack Oct 20, 2026
f65b863
Merge branch 'feat/working-memory-data' into feat/family-e2e-calibration
Pfannkuchensack Oct 20, 2026
251ef4e
Merge remote-tracking branch 'origin/fix/vae-working-memory-dtype' in…
Pfannkuchensack Oct 20, 2026
d11164e
Merge remote-tracking branch 'origin/feat/family-e2e' into feat/famil…
Pfannkuchensack Oct 20, 2026
5699fee
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 20, 2026
1914435
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 20, 2026
4803b1c
Merge branch 'feat/working-memory-denoise' into feat/working-memory-f…
Pfannkuchensack Oct 20, 2026
4de82a9
Merge remote-tracking branch 'upstream/main' into feat/family-e2e
Pfannkuchensack Oct 20, 2026
1227de3
test(e2e): pick a Z-Image-valid encoder in the graph export test
Pfannkuchensack Oct 20, 2026
6fa29e1
Merge remote-tracking branch 'origin/feat/family-e2e' into feat/famil…
Pfannkuchensack Oct 20, 2026
8d25d51
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 20, 2026
cf219bf
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 20, 2026
fc43a88
Merge branch 'feat/working-memory-denoise' into feat/working-memory-f…
Pfannkuchensack Oct 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/src/content/docs/configuration/Optimization/low-vram-mode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,19 @@ device_working_mem_gb: 4
Once decoding completes, the model manager "reclaims" the extra VRAM allocated as working memory for future model loading operations.
:::

#### Calibrating a model's working memory

Invoke's decode estimates are measured on a few reference GPUs. Your GPU, driver and settings can need more or less. A calibration measures what a model's VAE decode really takes on your GPU, and Invoke uses those measurements from then on.

- **What it runs**: a few short text-to-image generations of the model at three sizes, up to the largest your GPU can decode in one piece with the VAE fully loaded in the memory free on it when the calibration is planned, in each VAE precision the model can decode in. Before each measured operation, Invoke moves the other models off the GPU, so the measured model is fully loaded. Each size runs once to warm up and twice more. The generations go through the normal queue, so they wait behind queued work and appear there like any other generation.
- **Who and where**: administrators only. It needs exactly one GPU set as the generation device; with several, it is not available.
- **What it changes**: decodes up to the largest size measured use the measured values, plus the same 5% margin the built-in values carry. Measurements that a fragmented GPU memory pool inflated, or taken while the VAE was only partly on the GPU, are left out, and the Model Manager shows those sizes as not counted. Larger decodes use whichever of the measured and the built-in estimate is larger. Other models that decode the same way (for example, SD1.5 and SDXL models when you calibrate an SDXL model) use the measurements too. Because the estimate decides when a large decode is split into tiles up front, a calibration can change which large images are decoded in tiles.
- **Where it applies**: on this kind of GPU only (identical cards share it), and only while the software that affects memory stays the same: the operating system, the PyTorch and GPU runtime versions, the memory-related environment variables and Invoke's memory settings. After such a change Invoke goes back to the built-in values until you calibrate again. A driver update keeps the measurements but marks them as possibly out of date until you calibrate again.
- **What it does not cover**: image-to-image and inpainting encodes keep the built-in values.
- **Reset**: remove a model's calibration from the Model Manager, or every calibration of this GPU; the change applies right away. Resetting one model removes only its own measurements: where other models' measurements cover the same decode, those still apply, and the Model Manager shows which models measured it. Otherwise the built-in values apply again.

The measurements are stored next to the database in `working_memory/<device class id>.json`.

### Keeping a RAM weight copy

Invoke has the option of keeping a RAM copy of all model weights, even when they are loaded onto the GPU. This optimization is _on_ by default, and enables faster model switching and LoRA patching. Disabling this feature will reduce the average RAM load while running Invoke (peak RAM likely won't change), at the cost of slower model switching and LoRA patching. If you have limited RAM, you can disable this optimization:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ Packages are discovered automatically. A directory of node modules without an `_
...
```

Report progress with `context.util.sd_step_callback(state, BaseModelType.NewModel)`; it renders previews through the architecture's `LatentSpaceFacet`. The denoise node is also where these are checked: interrupts (`context.util.is_canceled()`), inpainting, img2img through `denoising_start`, and a working-memory estimate passed to `model_on_device(working_mem_bytes=<int>)`, or `working_memory=` for an estimator that declares an `EstimatorSpec`.
Report progress with `context.util.sd_step_callback(state, BaseModelType.NewModel)`; it renders previews through the architecture's `LatentSpaceFacet`. The denoise node is also where these are checked: interrupts (`context.util.is_canceled()`), inpainting, img2img through `denoising_start`, and a working-memory estimate passed to `model_on_device()`: `working_memory=` from an estimator that declares an `EstimatorSpec`, so that calibration runs measure the forward (the Z-Image denoise's is in `invokeai/backend/z_image/denoise_working_memory.py`), or `working_mem_bytes=<int>` for a plain reservation. A model locked while the transformer is, such as a ControlNet adapter, reserves the estimate's `reservation_bytes` with `working_mem_bytes=`.

4. **VAE encode and decode** (`vae/new_model_image_to_latents.py`, `vae/new_model_latents_to_image.py`)

Expand Down
114 changes: 110 additions & 4 deletions docs/src/content/docs/development/Architecture/model-manager.mdx

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/src/content/docs/development/Architecture/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ The invoker (`/invokeai/app/services/invoker.py`) is the primary interface throu
- **invocation services**, which are used by invocations to interact with core functionality.
- **invoker services**, which are used by the invoker to manage sessions and manage the invocation queue.

Creating the invoker starts every service, the session processor last: its workers dequeue at once, and an item left pending before the restart may use any other service. (The queue's start cancels the items that were in progress.) `stop()` signals the session processor first, so that its workers stop taking items and cancel their sessions before the other services stop; it does not wait for the workers.

### Sessions

Invocations and links between them form a graph, which is maintained in a session. Sessions can be queued for invocation, which will execute their graph (either the next ready invocation, or all invocations). Sessions also maintain execution history for the graph (including storage of any outputs). An invocation may be added to a session at any time, and there is capability to add and entire graph at once, as well as to automatically link new invocations to previous invocations. Invocations can not be deleted or modified once added.
Expand Down
Loading
Loading