ComfyUI Node

Spectrum Patcher (Max)

Skip half your denoising steps without touching the checkpoint

By maximilianwicen·Created 6 months ago·Updated 6 months ago· 11
Spectrum Patcher (Max)
  • model
  • MODEL
w0.50
m4
lam0.100
window_size2

Most speed tricks in this hobby are trained in: LCM, Turbo, Lightning, Hyper - each bakes a compressed sampling trajectory into a LoRA or a new checkpoint, and each trades quality you can't get back. Spectrum Patcher (Max) is the other flavor. It's training-free. No extra model files, no sampler changes, fully reversible per workflow. It watches how the denoiser has behaved over the last few steps and guesses the output for the next few, so the big network doesn't run every time.

Under the hood this is a port of Spectrum (Adaptive Spectral Feature Forecasting for Diffusion Sampling Acceleration, a CVPR 2026 paper), wrapped as a ComfyUI model patcher. It sits between your model loader and sampler, taking a MODEL in and handing a patched MODEL back. If you've used DeepCache-style caching nodes, you know the trade-off shape: fewer forward passes, real speedup, and an honest risk of visual drift if you push it too hard.

How it actually works

The node wraps your UNet/DiT forward pass with set_model_unet_function_wrapper(...), intercepting every call the sampler makes. On real steps it caches the model's output tensor (the noise/eps prediction) alongside the timestep. Once it has a little history - a couple of real passes minimum - it fits a small polynomial through those (timestep, output) points using Chebyshev basis functions and ridge regression.

On skipped steps it evaluates that polynomial at the current timestep instead of calling the network, and hands the predicted output tensor back to the sampler as if the model had just run. The prediction is blended with the last real result by w, so one bad forecast can't send the whole image sideways. And the code is conservative on purpose: if the fit fails, throws NaNs or Infs, or the tensor shape or dtype changes, it silently falls back to a real model call. A wrong prediction is a broken image; a real call is just slow.

The four knobs that matter

  • window_size - the big one. Run a real pass every Nth step and forecast the rest. window_size = 2 means half your steps are skipped; the author suggests 4 for roughly 75% fewer model evaluations. Higher = faster, and also more drift.
  • m - Chebyshev polynomial degree (basis count). Too low and shapes come out flat; too high and you invite wavy artifacts. 4 is the sane default.
  • lam - ridge regularization strength. The dampener: more stability, slightly muted detail.
  • w - how much forecast vs. last-known-truth on skipped steps. 0.5 is the safe middle; pushing toward 1.0 gets sharper but jittery.

Output is a single MODEL - wire it where the model loader used to go.

Install

No extra Python dependencies, no model downloads - the whole node is one file on top of plain torch. Clone it (the README wants a clean folder name) and restart ComfyUI:

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/maximilianwicen/ComfyUI-Node-for-Adaptive-Spectral-Feature-Forecasting-for-Diffusion-Sampling-Acceleration.git ComfyUI-Max-Spectrum

ComfyUI Manager can grab it by searching the pack title, though the rename the README recommends is worth doing either way. You'll find Spectrum Patcher (Max) under model/patches.

Where people get burned

First: this needs steps. It's a forecast over a trajectory, and it needs trajectory to work. Slap it after a 4-step Lightning or Turbo LoRA and there's nothing to forecast - the author flat-out says it won't work with speed LoRAs. It shines at 20–50 step schedules.

Second, the quality tax is real and model-dependent - one report notes Z-Image "isn't fond of black magic nodes like these." Test per model with a fixed seed, one knob at a time.

Third, and worth knowing before you build a workflow around it: this is a simplified port, and it's been called out for it. The paper's actual trick is to forecast the model's final hidden feature before the output head, then still run that tiny head on the prediction. This node instead forecasts the entire model output tensor and skips the whole network on forecast steps - cheaper per skip, but less faithful to the paper, and the follow-up "Spectrum Proper" ports argue that wrong target causes compounding error at high skip ratios. At moderate window_size the difference is often invisible; for aggressive speedups on FLUX, the faithful ports are worth a look first.

None of that makes this node a dud: free speed on hardware you already own, reversible, and its own fallback logic keeps it from nuking a run. Start at window_size = 2, keep w at 0.5, and see whether your eyes can tell before your wallet does.

Categorymodel/patches

Inputs (5)

NameTypeDefaultDescription
modelMODEL
wFLOAT0.500–1
mINT41–16
lamFLOAT0.1000–100
window_sizeINT21–32

Outputs (1)

NameTypeDescription
MODELMODEL