Nodes/ComfyUI-NoCache/NoCache Config
ComfyUI Node

NoCache Config

The NoCache Config node

By lihaoyun6·Created 7 months ago·Updated 6 months ago· 5
NoCache Config
      enabledtrue
      debugfalse

      You know that feeling when ComfyUI has been chugging through a big Flux or SDXL workflow for a while, and suddenly your system RAM is at 90% and the OS starts swapping? That's not a leak - it's ComfyUI working as designed. It caches the output of every node in system RAM so that re-running a workflow (or just tweaking one downstream value) is instant instead of recomputing everything. On a long chain - upscale passes, batch processing, video frame pipelines - those cached tensors pile up into multiple gigabytes.

      The ComfyUI-NoCache pack fixes this by letting you tell specific nodes "don't cache me." The NoCache Config node is its control panel: a per-workflow master switch for the whole behavior, sitting right on your canvas instead of hidden in a config file.

      How the pack actually works

      The core trick has nothing to do with this node. You tag a node's title with @NC (case-insensitive) and the pack patches ComfyUI's cache classes - BasicCache, HierarchicalCache, LRUCache, and the RAMPressureCache - so that node's output never gets written to the cache. Tag a node with @GC instead, and when it finishes the pack forces gc.collect() and empties the CUDA cache, freeing what the @NC nodes left behind. @NC only skips future caching, so a @GC node must sit after it in the graph.

      What makes NoCache Config special is that it isn't really a data node at all. It has no outputs and never executes as part of the graph - the patched executor reads its settings straight out of the workflow JSON before anything runs. That's why it works no matter where you drop it on the canvas, and why toggling it takes effect on your very next run. It's a settings card that travels with the workflow.

      The two toggles that matter

      That's the whole node - two boolean switches:

      • enabled (default true): the master switch for NoCache in this workflow. Flip it off and the workflow runs with stock ComfyUI caching, which is what you want when you're mid-iteration on a node and actually want cache speed back.
      • debug (default false): when on, ComfyUI prints a Node Cache Analysis Report to its console after each run - a table of every node holding a cache entry of 1MB or more, with logical cache size, actual RAM footprint, and a total. That's your cheat sheet for deciding which nodes deserve an @NC tag. Remember: that report goes to the terminal where you launched ComfyUI, not the browser.

      Where people get burned

      • Only one config node per workflow. The pack hard-errors with "Multiple 'NoCache Config' nodes detected! Please use only ONE per workflow." if you add two. This is the one failure mode this node actually has.
      • @GC after @NC, always. A @NC node can't free its own memory, and a GC tag that never runs just does nothing.
      • It's a surgical tool, not a RAM diet. Don't tag cheap, heavily-revisited nodes - skipped cache means recompute on every run. Tag the expensive intermediates: latents, decoded images, upscale outputs.
      • It's niche. This pack has essentially no community footprint (zero Reddit mentions as of writing). Modern ComfyUI already ships a RAM-pressure cache that auto-frees big inactive entries under pressure, and flags like --cache-none if you want to nuke caching globally. NoCache is for when you want deterministic, per-node control - know that before you reach for it.

      Installing

      Search "NoCache" in ComfyUI Manager, or from a terminal:

      cd ComfyUI/custom_nodes
      git clone https://github.com/lihaoyun6/ComfyUI-NoCache.git
      

      Then restart ComfyUI. That's the whole install - pyproject.toml declares zero Python dependencies and there are no model files. If you'd rather not use a config node at all, the pack's config.json holds the same enabled/debug flags plus a node_class list for always-skipping a given node type; edits there need a restart, which is exactly the friction the config node removes.

      CategoryNoCache

      Inputs (2)

      NameTypeDefaultDescription
      enabledBOOLEANtrue
      debugBOOLEANfalse

      Outputs (0)

      No outputs