Caching Controlnet Image to not Waste
Cache the pose map
- original_image
- executor
- original_image
- cached_controlnet_image
The expensive half of a ControlNet workflow is rarely the ControlNet itself - it's the preprocessor. That openpose skeleton, depth map, or canny edge extraction runs a whole model (DWPose, a depth estimator, whatever) on your source image, and ComfyUI reruns it on every generation. Same image, same prompt, same pose map, computed a hundred times. caching_controlnet from the Caching to not Waste pack runs the preprocessor once, saves its output, and serves it from disk forever after.
The author built this pack because his inpainting workflow was recomputing three different control images - openpose, depth, and canny - on every run, on hardware that kept running out of memory. Caching the control image kills two birds: you skip the preprocessor's forward pass, and because the executor input is lazy-evaluated, the preprocessor model itself never loads again. On a weak GPU that second part is often the bigger win.
How it works
Identical recipe to the rest of the pack: hash your source image's pixels plus an identification tag, write the preprocessor's output PNG to ComfyUI/output/caching_to_not_waste, and return it on later runs instead of executing anything. Cache hit means the entire preprocessor chain is skipped, not just its math.
What's nice here is that identification isn't a free-text field - it's a dropdown pre-filled with the standard control types: openpose, depth, lineart, scribble, mlsd, seg, normal, shuffle. Pick the one you're actually producing and you get both a sensible cache key and a readable filename. (The shuffle option is the content-shuffle control, for what it's worth; the list maps to the classic SD-era preprocessor set.)
The inputs that matter
original_image- the photo the control image derives from. Different source, different cache.executor- an IMAGE input. Your preprocessor chain: e.g. DWPose / OpenPose Pose, Depth Anything, Canny. Wire the preprocessor's output here.identification- the dropdown above. Unique per control type.force_recreate- true once to regenerate, then back off.
Outputs: original_image (passthrough) and cached_controlnet_image, which feeds into whatever consumes the preprocessor output - traditionally a ControlNet Apply node, or the newer apply-controlnet-with-model conditioning stack, depending on your ComfyUI version.
Installing it
Manager → Install Custom Nodes → search Caching to not Waste, or:
cd ComfyUI/custom_nodes
git clone https://github.com/alastor-666-1933/caching_to_not_waste
Restart ComfyUI. No extra Python dependencies, no model files to download - the pack uses only what ComfyUI ships. Cache files land in ComfyUI/output/caching_to_not_waste.
Where people get burned
The usual stale-cache trap: you swap your depth model or tweak preprocessor settings, and the old control image keeps coming back. Flip force_recreate on, run once, flip it off. And keep in mind that your control condition will be the exact pixels that were cached - if you ever change the source image's resolution or aspect ratio, the hash changes and you get a fresh cache anyway, so no risk of feeding a wrong-sized pose map to a new image.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| identification | COMBO | 8 options: openpose, depth, lineart, scribble, mlsd, seg, +2 | |
| original_image | IMAGE | — | |
| executor | IMAGE | — | |
| force_recreate | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| original_image | IMAGE | — |
| cached_controlnet_image | IMAGE | — |