Nodes/Smart Memory Override/Smart Memory Override (Model)
ComfyUI Node

Smart Memory Override (Model)

The One-Node Toggle That Replaces a Restart

By DHan315·Created 2 days ago·Updated a day ago· 0
Smart Memory Override (Model)
  • model
  • model
smart_memorydisable

ComfyUI's Smart Memory is a genuinely helpful automatic memory manager right up until the day it isn't - when an update makes a workflow that used to fit OOM, or a model you're comparing reloads from disk between runs and ruins your timing. The stock fix, --disable-smart-memory, is a launch flag, which means restarting the app. This node is the version that doesn't make you: Smart Memory Override (Model) flips the same switch at runtime, from a dropdown, mid-graph.

It's the flagship node of DHan315/ComfyUI-Smart-Memory-Override, and if you install that pack you get two single-purpose siblings (Disable and Enable) plus this combined toggle. Nine times out of ten, this is the one you want.

How it works

Wire a loaded model in, pick a state, done. Under the hood the node sets comfy.model_management.DISABLE_SMART_MEMORY to True or False - the exact same global variable that the --disable-smart-memory launch flag initializes at startup - and mirrors it into ComfyUI's CLI args so nothing contradicts itself. The model itself is passed through byte-for-byte untouched. Like its siblings, the model socket is really an execution hook: ComfyUI runs nodes in dependency order, so threading your loader's output through this node is how you make the flag flip after the model loads and before the sampler runs.

The pack's README shows the intended shape: Klein Model Loader → this node → sampler. That's aimed at Klein (the small Flux 2 family - 4B vs 9B, base vs distilled) users doing A/B comparisons, where you want to control exactly when the memory manager caches and offloads. The author's own framing is worth taking literally: for a clean Klein A/B test, don't stack this with the old Disable Dynamic VRAM node - you're not testing Dynamic VRAM, and two memory controllers in one run just contaminate the results.

The inputs that matter

Two, and only one is interesting:

  • model (MODEL) - the model you want to pass through. Any loaded model works.
  • smart_memory (dropdown: disable / enable, default disable) - the whole point of the node. Pick where you want Smart Memory's state to land.

Output is a single model (MODEL), identical to what went in. It should go straight into your sampler's model input.

Why the default is disable: the pack exists because people were hitting problems with Smart Memory on and wanting it off. If you want on, it's one click - and that one-click toggle is the reason to use this node instead of the fixed Disable/Enable pair. Swap modes without swapping nodes.

Installing it

ComfyUI Manager, search Smart Memory Override, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/DHan315/ComfyUI-Smart-Memory-Override

That's the entire install. Zero external dependencies (the package file is empty), no model downloads, nothing to configure. You just need a ComfyUI that actually has Smart Memory - a 2026-era build.

The gotchas

Read the README once and believe it: Smart Memory is global state, not per-model state. Flip it to disable and it stays disabled for everything that runs afterward in the session - other graphs included - until another override flips it back or you restart. The "per-model" feel of the socket is an illusion; the flag is process-wide.

Two practical consequences. First, execution order matters: the node only fires when its branch runs, and it affects nodes that execute after it, not the model you hung it on specifically. Second, there's no on-screen indicator of the current state - your only confirmation is the console line ("[Smart Memory Override] Smart Memory DISABLED (DISABLE_SMART_MEMORY=True)."). If a later workflow acts surprised, check that log. Restarting resets everything to your launch-flag defaults, which is also your escape hatch when you've toggled yourself into a confusing corner.

If you're comparing Klein checkpoints or fighting a post-update memory regression and want the fix without editing a startup script, this is the node. Toggle it off, run, toggle it on, run - no restarts between passes.

Categorymodel_patches/memory

Inputs (2)

NameTypeDefaultDescription
modelMODEL
smart_memoryCOMBOdisable2 options: disable, enable

Outputs (1)

NameTypeDescription
modelMODEL