Nodes/SAX Bridge/SAX Cache
ComfyUI Node

SAX Cache

DeepCache speedups for the whole pipe, with a quality dial you control

By so16tm·Created 6 months ago·Updated 3 months ago· 0
SAX Cache
  • pipe
  • PIPE
enabledtrue
deepcache_interval3
deepcache_start_percent0.20

SAX Cache is the node that makes a workflow faster without you changing the model or the sampler. It applies DeepCache to whatever model is riding in your pipe, and because every downstream SAX node - the KSampler, the upscaler's i2i pass, the detailer's redraws - reads from that same pipe, one Cache node speeds up the whole chain, not just a single sampler. If your renders are taking long enough that you've been thinking about a lighter model or fewer steps, this is the softer landing.

DeepCache isn't a new idea. It's a well-known trick from the CVPR 2024 paper of the same name ("DeepCache: Accelerating Diffusion Models for Free"): diffusion models recompute the full network every step, but large parts of the model (especially early feature layers) change only slowly across steps. DeepCache notices that, computes those layers once every N steps, and reuses the cached features in between. You lose a little quality and you gain a lot of wall-clock time - the classic speed/quality trade, except this one costs you nothing to set up.

The inputs that matter

Three knobs, and only two of them really matter:

  • enabled - the master switch. False returns the pipe untouched, which makes A/B testing "is the cache hurting quality?" a one-click question.
  • deepcache_interval (default 3, range 1–10) - how often the full computation runs. 1 means every step runs fully, i.e. DeepCache effectively disabled. Higher = faster, and more quality risk. 2–4 is the sane band; 10 is for when you're desperate.
  • deepcache_start_percent (default 0.2) - the fraction of denoising that runs normally before the cache kicks in. Early denoising steps set the composition, so the author keeps the first ~20% uncached to preserve quality where it matters most. Lower it to squeeze more speed, raise it if early composition quality dips.

A caveat worth respecting: cache-based speedups assume the model does a lot of redundant recomputation, which is exactly how classic CFG-driven diffusion behaves. If you're on a CFG-1 flow-matching model, there's less redundancy to exploit and quality degrades faster - so keep the interval modest (2–3) and lean on deepcache_start_percent as your quality guard. DeepCache is a "free speed" trick, not a free lunch.

How to use it

Slot it between your loader and your sampler, right on the pipe line:

SAX Loader → SAX Cache → SAX Prompt → SAX KSampler → ...

It replaces the model in the pipe with the DeepCache-wrapped version and passes the pipe on, so everything downstream inherits the speedup. That's the elegant part - you don't wrap the model once per sampler; you wrap it once and the pipe carries it.

Practical advice: start at the defaults (interval 3, start 20%), run a render, and compare it side by side with enabled=False using SAX Image Collector + SAX Image Preview. If you can't tell the difference at your viewing resolution, you just found free speed. If you can, bump deepcache_start_percent before you touch the interval - preserving the early steps buys back more quality per unit of speed than lowering the interval does.

Installing

Part of the pack, no extra dependency:

cd ComfyUI/custom_nodes
git clone https://github.com/so16tm/SAX_Bridge

Restart, then SAX/Bridge/Utility → SAX Cache. It's one of the few genuinely "set and forget" nodes in the pack - tune it once, leave it in.

CategorySAX/Bridge/Utility

Inputs (4)

NameTypeDefaultDescription
pipePIPE_LINE
enabledBOOLEANtrueWhen False, returns the pipe as-is without applying any cache.
deepcache_intervalINT31–101=DeepCache disabled. Runs full computation once every N steps; remaining steps use the cache.
deepcache_start_percentFLOAT0.200–1Denoising progress ratio at which DeepCache kicks in. Early steps run normally to preserve quality.

Outputs (1)

NameTypeDescription
PIPEPIPE_LINE