Nodes/ComfyUI-SuperNodes/🐧 Set Reserve VRAM
ComfyUI Node

🐧 Set Reserve VRAM

Reserve VRAM from inside the workflow instead of restarting with a flag

By sonnyboxΒ·Created 11 months agoΒ·Updated 3 days agoΒ· 12
🐧 Set Reserve VRAM
  • any
  • watchers
  • any
β—„reserved_gb0.0β–Ί
β—„free_vramfalseβ–Ί

OOM debugging in ComfyUI usually means the same ritual: figure out which stage ate your VRAM, edit the launch args, restart, re-run, find the next OOM. This node breaks that loop. It sets ComfyUI's --reserve-vram value - the headroom it keeps free for the OS, display, and other processes - at runtime, from inside the graph. You can raise the reserve before a heavy stage, then hand it back afterwards, all in one queue run.

It's part of the 🐧 SuperNodes pack by SuperCC, and it's honest about being a debugging tool: it's an output node that sits in your workflow, does its thing, and lets execution continue.

How it works

  • any - an anything-input passthrough. Wire it in front of whatever stage the reserve should apply to; the node returns the same value on its any output, so it can sit inline without breaking the data flow.
  • reserved_gb - the amount to reserve. The clever bit is the value semantics: 0.0 restores the values ComfyUI booted with (the out-of-box experience you actually want back), and a negative value means true zero reserve. So the slider isn't "0 = reserve nothing," it's "0 = back to normal."

Under the hood it writes ComfyUI's EXTRA_RESERVED_VRAM and, when DynamicVRAM (aimdo) is active, updates the native allocator's headroom global too - that second part matters because core only wires --reserve-vram into the dynamic loader at startup. A reserve change only governs future allocations, which is why the passthrough matters: you place the node so it runs before the memory-hungry stage.

When you'd reach for it

  • A model load or a big VAE decode is OOMing, and you want to test whether reserving headroom helps - without touching launch flags.
  • Workflows that alternate between a VRAM-hungry stage and something that needs the GPU freed up for other work (e.g. two models fighting over the card).
  • Diagnosing whether your OOM is "not enough VRAM" or "ComfyUI is allocating to the last byte" - reserving a chunk and seeing the failure move is itself useful information.

Install

ComfyUI Manager, search "ComfyUI-SuperNodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/sonnybox/ComfyUI-SuperNodes

Restart ComfyUI. No model downloads. The pack's only extra dependency is matplotlib (Sigmas Graph only). This pack uses ComfyUI's newer extension API, so a stale ComfyUI won't load any of it.

Gotchas

  • It changes future allocations, not the past. If your OOM happens before this node runs in execution order, you placed it wrong - the any passthrough is there precisely so you can force ordering.
  • Reserve too much and you create the OOM you were trying to fix; the slider runs to 1024GB because it's a generic tool, not because reserving 500GB is ever a good idea. Start small (0.5–2GB).
  • It's a workflow-side tool, not a persistent setting. For a permanent reserve, the launch flag is still the right place - this is for testing and per-stage control.

It's the kind of node you don't need until you desperately need it, and then it saves you three restarts in a row. Keep it in mind the next time you're watching a model load die on the last 200MB.

CategorySuperNodes/Tools

Inputs (4)

NameTypeDefaultDescription
reserved_gbFLOAT0.0-1–128Set to 0 to restore values at start up. Set a negative number for true zero reserve.
free_vramBOOLEANfalseβ€”
anyopt*β€”
watchersoptCOMFY_AUTOGROW_V3β€”

Outputs (1)

NameTypeDescription
any*β€”