Nodes/WtlNodes/Cache Accelerator
ComfyUI Node

Cache Accelerator

Cache Accelerator

By Scorpiosis0·Created 10 months ago·Updated 2 months ago· 3
Cache Accelerator
  • model
  • MODEL
cache_interval2
start_percent0.20
end_percent0.80
verbosefalse

Sampling speed is the eternal ComfyUI complaint, and there's a family of tricks that attack it by noticing something: across a run of diffusion steps, consecutive latents barely change - so why recompute the whole transformer every single step? Cache Accelerator is WtlNodes' entry in that family. You slot it between your model loader and sampler, and it skips a fraction of the model's forward passes, reusing a cached activation that's been scaled to the current timestep.

It's the same philosophy as the "block cache"-style nodes floating around the ecosystem, done with the pack's own math. It won't beat a well-tuned distil or a step-count reduction on its own, but it stacks with them - and since it costs nothing to add, it's the kind of node you drop in and benchmark.

How it works

The node patches your model (a cloned MODEL comes back out) with three wrappers: one for the forward pass, one for conditioning-batch computation, and one that books the whole thing around the sampler. Inside a time window it tracks when the previous step's activation was cached and, every cache_interval-th step, returns the cached, sigma-scaled activation instead of running the transformer. It's careful about parameterization: it validates that the "denoise is invertible" formula holds (true for epsilon and flow-matching models, not for v-pred), and silently disables the risky path if the math doesn't line up. That check is the reason this doesn't just artifact everywhere.

The inputs that matter

  • cache_interval - skip every N-th step in the window (default 2). 1 means every step is skipped except the cache-update steps, which is aggressive; 2–3 is the sane starting range.
  • start_percent / end_percent - the sigma window (as a fraction of the schedule, default 0.2–0.8) where caching is active. Steps near the end of sampling are where detail is actually decided, so leaving the tail uncached protects quality.
  • verbose - turn on and the node logs what it skipped and the estimated speedup at the end of the run. Worth enabling once just to see if it's doing anything.

One MODEL output, straight into your sampler's model input.

What to expect

A 10–30% wall-clock reduction on many SDXL/SD1.5 runs, sometimes more on longer schedules, with quality loss that's usually minor if you keep the interval modest. Where people get burned: cranking cache_interval to 5–10 "for more speed," getting visible strobing or ghosting, and blaming the node. It's a speed-vs-fidelity dial, not a free lunch.

Install

Part of WtlNodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Scorpiosis0/ComfyUI-WtlNodes.git

Restart ComfyUI (or use ComfyUI Manager → search "WtlNodes"). No model files, no heavy deps.

Troubleshooting

  • "Skipped 0 steps" in verbose output: your window is set wrong, the schedule is too short, or you're on a model the invertibility check rejected. Verify start_percent < end_percent and that your sampler uses enough steps for a window to exist.
  • Artifacts / quality regression: lower the interval to 2 and shrink the window (start_percent up, end_percent down). Test against a baseline with verbose on.
  • It does nothing on some setups: cache tricks are sensitive to ComfyUI version and model architecture. If the log shows nothing cached, it's not your fault - check the model patcher version, then move on. Not every sampler run benefits.
CategoryWtlNodes/sampling

Inputs (5)

NameTypeDefaultDescription
modelMODEL
cache_intervalINT21–10
start_percentFLOAT0.200–1
end_percentFLOAT0.800–1
verboseBOOLEANfalse

Outputs (1)

NameTypeDescription
MODELMODEL