Nodes/BetterNormalCrafterWrapper/NormalCrafter Clean - Offload
ComfyUI Node

NormalCrafter Clean - Offload

The polite way to hand VRAM back after generating normals

By kaski23·Created 2 months ago·Updated 2 months ago· 0
NormalCrafter Clean - Offload
  • model
  • model

This is the unglamorous node that saves you from unglamorous problems. It takes the model object from the Load node, moves every component back to CPU, clears the CUDA allocator cache, and passes the model through unchanged. That's the whole job - and in a long graph, it can be the difference between the next node fitting on your card and OOM-killing your session.

You might be asking "doesn't Generate already clean up?" Mostly, yes: the generate node has an offload_after toggle that soft-empties the cache when it's done. The Offload node exists for the cases where that isn't precise enough - when you're running a long multi-stage graph and you want to control exactly when NormalCrafter relinquishes its VRAM, independent of where in the graph generation happens. It's the same lifecycle cleanup the engine uses internally, exposed as a wire you can place wherever you like.

It's dead simple to use:

  • Input: the model output from NormalCrafterCleanLoader. It doesn't need to have run generation yet - you can offload before or after, whenever you want the VRAM back.
  • Output: the same model, still usable later if a downstream node needs it again.

Wire it between your generate step and the rest of the graph - say, before a heavy upscaler or a second generation - and the model drops to CPU plus the allocator cache is cleared (torch.empty_cache() plus ComfyUI's own soft_empty_cache) before the next node runs. No state is lost; the model isn't destroyed, it's just parked.

Installing

It ships in the same pack, so if you already have the others you're done:

cd ComfyUI/custom_nodes
git clone https://github.com/kaski23/BetterNormalCrafterWrapper
cd BetterNormalCrafterWrapper
pip install -r requirements.txt

Then restart ComfyUI. ComfyUI Manager also finds it under BetterNormalCrafterWrapper.

When you'd bother

Honest answer: for a single short clip, you won't notice it. It earns its keep in graphs that chain several model-heavy steps on a card with headroom to spare but not much to spare - where every GB counts and you don't want to trust the auto-offload timing. If you're swapping between NormalCrafter and, say, a big depth model in one workflow, dropping this node in before the switch keeps both runs happy. If your card never gets tight, skip it and let offload_after do the work. It's a tool for control freaks - which, if you're building video normals pipelines in ComfyUI, you probably are.

CategoryNormalCrafter/Clean

Inputs (1)

NameTypeDefaultDescription
modelNORMALCRAFTER_CLEAN_MODEL

Outputs (1)

NameTypeDescription
modelNORMALCRAFTER_CLEAN_MODEL