Nodes/ComfyUI DeOldify/DeOldify Clear Cache
ComfyUI Node

DeOldify Clear Cache

Freeing VRAM after a DeOldify run

By Praveenhalder·Created 6 months ago·Updated 6 months ago· 0
DeOldify Clear Cache

      DeOldify Clear Cache is the rare node that does exactly nothing you can see - and that's the whole point. It takes no inputs, produces no outputs, and exists for one reason: getting your VRAM back after DeOldify Colorize has hogged it. If you've ever colorized a batch of old photos and then hit an out-of-memory error the moment you tried to run a real diffusion job, this is the release valve you were missing.

      Why it needs to exist

      Here's the thing about the sibling node in this pack: DeOldify Colorize keeps its loaded model in memory, cached per model type and device. That's deliberate - it's what makes a second colorization run fast instead of re-importing a multi-hundred-MB GAN and re-juggling fastai. But the trade-off is that the cached colorizer sits in VRAM after your run finishes, quietly holding memory while you move on to other things. On a 4–8 GB card, that's the difference between "runs fine" and "CUDA out of memory" on the next step in your workflow.

      This node is the cure. Its clear() method wipes the in-memory colorizer cache and then calls torch.cuda.empty_cache() to hand the freed VRAM back to the driver. It's an output node, so ComfyUI executes it and the console logs "Model cache cleared." That's the entire job description.

      How to use it

      Because it has no inputs, you can't really wire it into a data flow - there's nothing to connect. Realistically it's a button you run between jobs. Two ways to think about it:

      • Drop it into a workflow and hit Run when you want to free memory before a heavy step.
      • Or just run it on its own after a colorization batch, before you switch to a model that needs the VRAM.

      The one nuance: since the cache is keyed by model type and device, clearing it doesn't just free memory - it also means the next colorization run will re-import the model from scratch. That's the price of the release valve, and it's a fair one. If you're about to do another DeOldify pass, don't clear the cache first; only clear it when you're done with DeOldify for a while.

      The honest take

      This is a tiny utility node, and nobody should build a workflow around it. But it's the kind of thing that saves you a ComfyUI restart, and when you're mid-session with a batch of colorizations on a modest GPU, that's genuinely useful. You'd never search for it by name, but you'll be glad it's there the first time the cached colorizer and your next diffusion run fight over the same 8 GB.

      Categoryimage/color

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs