DiT Spectrum Patch
Block-caching acceleration for your existing sampler graph
- model
- MODEL
If you already have a working sampling graph - stock KSampler, KSampler Advanced, a Custom Sampler chain with other wrappers - and you don't want to rebuild it around a new sampler node, this is the way in. DiT Spectrum Patch is Spectrum's core caching trick exposed as a plain MODEL → MODEL patcher: wire it before whatever sampler you already use and it accelerates that sampler transparently.
CheckpointLoader / model loader → DiT Spectrum Patch → KSampler / KSampler Advanced / Custom Sampler
What it does, and - importantly - what it doesn't
This node is the caching mechanism only, stripped down to nothing else. Same family as TeaCache-style step-caching accelerators: it forecasts DiT feature outputs instead of computing every step in full. Specifically, on cached steps it predicts the transformer feature immediately before Anima's final_layer from a Chebyshev ridge-regression fit over recent actual steps, then runs only final_layer + unpatchify - skipping every transformer block for that step. On actual steps, the full model runs and its feature gets captured to feed the forecaster.
What it explicitly does not do: no modulation guidance, no DCW, no SMC-CFG, no SPEED/SPD multi-resolution, no noise generation or latent padding, no custom sampling loop. It's a caching wrapper and nothing more - for the correction stack, chain DiT CFG-FSG/DCW Patch or Anima Mod Guidance separately.
Inputs and outputs that matter
steps- has to match your downstream sampler's own step count exactly. This is the one setting most likely to bite you: change your sampler's steps and forget to update this node, and the forecaster's internal schedule desyncs from what the sampler is actually doing.window_size/flex_window/warmup_steps- the same adaptive caching schedule as the integrated samplers:warmup_stepsforces full compute up front, then an actual forward runs everyfloor(window_size)cached steps, growing byflex_windowafter each real forward. Raiseflex_windowfor more speed, lower it (or raisewarmup_steps) for more fidelity.tail_actual_steps(default3) - the final N steps are always forced to actual forwards, protecting the last stretch of denoising (where detail resolves) from ever being a forecasted guess.enabled- flip tofalseto pass the input model through completely unchanged, a clean kill switch for A/B testing.one_sampler_only- if the same patched model feeds multiple samplers in one workflow run (a hi-res-fix second pass, for instance), setting thistrueapplies Spectrum only to the first sampler that consumes it; later ones in that same run pass through untouched. It re-arms automatically on the next full workflow execution.verbose- logs the actual/cached decision per step, useful for confirming the schedule is doing what you expect.
Output is a patched MODEL.
Installing it
ComfyUI Manager - search SpectrumKSampler, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/sorryhyun/ComfyUI-Spectrum-KSampler
Restart - no model weight downloads for this node specifically; it's pure computation, no auto-fetched assets.
Common issues & troubleshooting
Output looks subtly off, or the schedule seems desynced. Check steps first - it has to match your sampler's step count. This is the single most common way to misconfigure this node.
Spectrum applied to a hi-res-fix pass when you didn't want it to. If the same patched model feeds two sampler nodes in sequence, both get accelerated by default. Set one_sampler_only = true to limit it to the first run.
Node errors instead of producing garbage on a non-DiT model. That's deliberate - the pack fails loudly with a clear error on non-DiT models rather than silently producing invalid output, so if you see that error, it means you've wired this into a checkpoint it genuinely can't accelerate, not that something else went wrong.
Need it to play nicely with a chained attention-backend wrapper or Custom Sampler flow. This basic node has no compatibility controls - for that, use DiT Spectrum Patch Advanced, which adds a compat_policy setting specifically for wrapper-heavy or multi-conditioning graphs.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | DiT MODEL to patch with Spectrum. | |
| steps | INT | 301–10000 | Must match the downstream sampler's steps. |
| window_size | FLOAT | 2.001–10 | Initial caching window; 1.0 disables cached steps. |
| flex_window | FLOAT | 0.250–2 | Window growth after each actual forward. |
| warmup_steps | INT | 60–10000 | Initial steps forced to actual DiT forwards. |
| tail_actual_steps | INT | 30–10000 | Final steps forced to actual DiT forwards. |
| blend_w | FLOAT | 0.300–1 | Chebyshev/Taylor blend weight; 1.0 is pure Chebyshev. |
| cheby_degree | INT | 31–10 | Chebyshev polynomial degree. |
| ridge_lambda | FLOAT | 0.100.001–10 | Ridge regression regularization strength. |
| history_size | INT | 1005–10000 | Forecaster buffer size. |
| enabled | BOOLEAN | true | — |
| one_sampler_only | BOOLEAN | false | Apply Spectrum only to the first sampler run that uses this patched MODEL within a workflow run; later sampler runs (e.g. hi-res fix) pass through. Re-arms on each new workflow execution. |
| verbose | BOOLEAN | false | Log actual/cached step decisions. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |