Nodes/comfyui_dreamlite/DreamLite Clear Cache
ComfyUI Node

DreamLite Clear Cache

Zero inputs, zero outputs, sometimes exactly what you need

By lussifa·Created 4 months ago·Updated 4 months ago· 0
DreamLite Clear Cache

      DreamLite Generate/Edit keeps its whole pipeline alive in memory. Every time it runs, it loads a diffusers-style pipeline - the transformers stack, the model weights, the works - into a module-level cache so the next call doesn't have to reload from disk. That's great for iterating on a prompt and terrible for your VRAM when you're done. DreamLite Clear Cache is the eject button.

      It has no inputs and no outputs. You can't wire anything to it, and you wouldn't want to. It's an output node, so it just runs when the queue reaches it, does its job, and returns nothing. The job is three lines: clear the pack's in-memory pipeline cache, run Python's garbage collector, and - if you're on CUDA - call torch.cuda.empty_cache(). No knobs, no config, nothing to get wrong.

      When would you actually queue it? The pipeline cache is keyed by model path, repo, variant, dtype and device. Switch from base to mobile in a workflow and the old base pipeline stays resident unless you evict it - two models quietly sharing your card without asking. Or you've finished a batch and want the memory back before loading something heavy, without bouncing the whole server. It's effectively the pack's soft version of the README's blunt instruction to "restart ComfyUI to fully unload" the pipeline.

      One honest caveat: this only evicts the DreamLite cache. Python doesn't always hand freed GPU memory straight back to the driver, and empty_cache can only reclaim what PyTorch isn't still holding for reuse. If you really need the VRAM back, a restart is still the nuclear option. This node is the quick version - right for most day-to-day use, not a substitute for a clean boot when memory pressure is real.

      Installing it is just installing the pack - it ships inside lussifa/comfyui_dreamlite, so ComfyUI Manager can grab the pack if it finds it, or you clone it into ComfyUI/custom_nodes and pip install -r requirements.txt like any node. There's no model to download for this node itself; the heavy lifting lives in its sibling, which is exactly why the cache exists in the first place. Worth keeping this one handy in the same graph - the moment DreamLite actually loads something, you'll want a way to set it down again.

      CategoryDreamLite

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs