Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 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
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
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
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
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
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
afc05b3
feat(e2e): bundle runs as shareable zips and record model identity
Pfannkuchensack Oct 21, 2026
a91a6a8
feat(e2e): describe bundle format and read only same-profile runs
Pfannkuchensack Oct 21, 2026
8b5fe87
test(e2e): place the fake memory peak inside the measured run window
Pfannkuchensack Oct 21, 2026
cbbb998
feat(e2e): mark expected changes and report self-referenced baselines
Pfannkuchensack Oct 21, 2026
b012444
fix(working-memory): wait for session workers on stop and fence calib…
Pfannkuchensack Oct 21, 2026
abff2f5
Merge branch 'feat/working-memory-data' into feat/family-e2e-calibration
Pfannkuchensack Oct 21, 2026
2e7a31e
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 21, 2026
d159929
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 21, 2026
eb6f45d
feat(e2e): ship each case's reference metadata in bundles
Pfannkuchensack Oct 21, 2026
213c23b
Merge remote-tracking branch 'upstream/main' into feat/working-memory…
Pfannkuchensack Oct 21, 2026
1359cb9
fix(working-memory): use the shared dedicated-VRAM check in the calib…
Pfannkuchensack Oct 21, 2026
7ef678e
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 21, 2026
1370b23
fix(working-memory): refuse unwritable stores and duplicate enqueues …
Pfannkuchensack Oct 21, 2026
df8e071
Merge branch 'feat/working-memory-data' into feat/family-e2e-calibration
Pfannkuchensack Oct 21, 2026
38d0d3b
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 21, 2026
5fa9a67
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 21, 2026
a344878
Merge branch 'main' into feat/working-memory-user-calibration
Pfannkuchensack Oct 21, 2026
07bc26b
Merge branch 'main' into feat/family-e2e-calibration
Pfannkuchensack Oct 21, 2026
7efc2d2
Merge branch 'main' into feat/family-e2e
Pfannkuchensack Oct 21, 2026
9f2345c
fix(working-memory): serialize calibration run creation across processes
Pfannkuchensack Oct 21, 2026
f8d0fb7
Merge branch 'feat/working-memory-data' into feat/family-e2e-calibration
Pfannkuchensack Oct 21, 2026
0874b20
Merge remote-tracking branch 'upstream/main' into feat/working-memory…
Pfannkuchensack Oct 21, 2026
62d75d8
test(processor): release the wake-up test's gates before a stop that …
Pfannkuchensack Oct 21, 2026
9a0ff66
Merge branch 'feat/working-memory-data' into feat/family-e2e-calibration
Pfannkuchensack Oct 21, 2026
5e17db0
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 21, 2026
2e4a791
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 21, 2026
3bb86a4
Merge remote-tracking branch 'upstream/main' into feat/working-memory…
Pfannkuchensack Oct 22, 2026
cd23115
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 22, 2026
6c9b69b
Merge branch 'main' into feat/family-e2e
Pfannkuchensack Oct 22, 2026
9f87a27
fix(working-memory): record a calibration item cleared before its que…
Pfannkuchensack Oct 22, 2026
5d21f4f
Merge branch 'feat/working-memory-data' into feat/family-e2e-calibration
Pfannkuchensack Oct 22, 2026
30e6ad3
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 22, 2026
93b50f9
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 22, 2026
4bdbf74
Merge remote-tracking branch 'upstream/main' into feat/working-memory…
Pfannkuchensack Oct 22, 2026
c9edbfe
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 22, 2026
b2a02cc
feat(e2e): sample GPU memory through NVML on Linux NVIDIA
Pfannkuchensack Oct 22, 2026
8d997fc
fix(e2e): count weightless tokenizer loads as resident
Pfannkuchensack Oct 22, 2026
edba0dd
feat(working-memory): mark the Linux NVML reader as verified on hardware
Pfannkuchensack Oct 22, 2026
a3269f7
Merge remote-tracking branch 'origin/feat/family-e2e' into feat/famil…
Pfannkuchensack Oct 22, 2026
f6db36f
Merge remote-tracking branch 'origin/feat/working-memory-calibration-…
Pfannkuchensack Oct 22, 2026
41898f2
Merge branch 'feat/family-e2e-calibration' into feat/working-memory-u…
Pfannkuchensack Oct 22, 2026
ee04529
test(working-memory): expect the Linux NVML reader to be verified
Pfannkuchensack Oct 22, 2026
7ed3a1a
Merge branch 'feat/working-memory-user-calibration' into feat/working…
Pfannkuchensack Oct 22, 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
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Main agent also owns machine-wide resources: dependency installs, generated API
- `-n logical` fits CI runners that own the machine. Dev box: cap workers (`-n 4`, or plain `pytest`). Set `OMP_NUM_THREADS` when a run must stay light. Never start a suite during a generation.
- `uv run --no-sync mypy scripts/invokeai-web.py` uses current exclusions. Optional diagnostic only: not a CI gate, not full type coverage.
- Pick checks by behavior. Run required milestone gates before review. Rerun unchanged checks only with a reason.
- Family E2E runs (`scripts/family_e2e`, guide: `docs/src/content/docs/development/Guides/family-e2e.mdx`) after changes to what a model computes or how it loads: model-manager loading, probing, configs; quantization; attention; model cache, working memory; invocations that run models; webv2 graph builders. Offer a run of the affected families, never start one unasked; none for docs-, test- or UI-only changes. Offer only where a manifest is set up; otherwise name the missing run under open limits in the final report. After a yes: run the base commit and `accept` it as reference (its bundle then reports BASELINE), then the branch, with `expect: changed` on the cases the PR is meant to change. PR description gets the `summary.md` table; attach the `bundle` zip. Until A/B runs exist, time differences under about 10 % between sessions are noise.
- Once test dependencies exist, install hooks per checkout: `uv run --no-sync pre-commit install`. Committed config does not install hooks.

## Scratch files and repository hygiene
Expand Down
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
Loading
Loading