Cache Accelerator
Cache Accelerator
- model
- MODEL
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_percentand that your sampler uses enough steps for a window to exist. - Artifacts / quality regression: lower the interval to 2 and shrink the window (
start_percentup,end_percentdown). Test against a baseline withverboseon. - 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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| cache_interval | INT | 21–10 | — |
| start_percent | FLOAT | 0.200–1 | — |
| end_percent | FLOAT | 0.800–1 | — |
| verbose | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |