This repository contains a Unnoficial ComfyUI custom node implementing the Spectrum sampling acceleration technique, tailored specifically for SDXL models. Spectrum is a training-free method that forecasts spectral features using Chebyshev polynomials and ridge regression to skip redundant UNet computations, achieving significant speed-ups with less quality loss.
Disclaimer: This implementation follows the official Spectrum paper logic but caches the outer feature rather than the inner feature approach.
Legacy / Non-Faithful Node: The
SpectrumSDXLCalibratednode is now considered legacy.Clarification for returning users: The previous version of this node was essentially "vibe-coded" from scratch because I couldn't initially find the official forecaster implementation. This led to some non-principled additions like "calibration" which, while interesting, are not faithful to the paper. This has now been solved by porting the official forecaster code into the
SpectrumSDXLnode. Please migrate to the faithful implementation for more stable and principled results.Performance comparison — Download the images below and drag them into ComfyUI to instantly load optimized workflows!
SDXL Calibrated Comparisons (30-step Euler)
Normal Spectrum Calibrated (strength 0.5) Calibrated (strength 0.8) 8.8 s 4.8 s 4.8 s 4.8 s 8.3 s 4.6 s 4.6 s 4.6 s Anima (30-step er-sde)
Default Spectrum 23.67 s 13.01 s
- Sampling Acceleration – Reduce inference time (up to ~2× on SDXL) by skipping UNet evaluations on selected timesteps.
- Vectorized Batch Processing – Fully vectorized mathematical operations process conditional and unconditional latents independently. This prevents memory contamination (rainbow artifacts) and sustains ultra-high
it/sspeeds without Python loop bottlenecks. - FP8 Tensor-Core Support – Compatible to run on NVIDIA Tensor Cores in FP8 mode, providing additional speed gains on compatible hardware. Works seamlessly alongside other optimizations.
- Sage-Attention Friendly – Orthogonal to Sage Attention; you can enable them together without conflicts.
- Stability Enhancements – Incorporates a "Sliding Window" memory limit (prevents mathematical explosions), alongside jitter and anti-NaN safeguards to keep low-precision runs (FP16/FP8) perfectly stable.
- Step-Based Quality Guard – A dedicated parameter allows you to seamlessly turn off the forecaster during the final critical steps, preserving high-frequency micro-details (like skin texture and eyes) and eliminating VAE-like compression blur.
- Navigate to the
custom_nodesdirectory of your ComfyUI installation. - Clone this repository:
git clone https://github.com/ruwwww/comfyui-spectrum-sdxl
- Restart ComfyUI.
| Parameter | Description |
|---|---|
w |
Blending weight between predicted and last true features. Lower values (0.4–0.5) rely more on local momentum (Taylor), preserving sharpness, while higher values rely on global spectral smoothing (Chebyshev). |
m |
Number of Chebyshev polynomial basis functions (forecast complexity). Lower values (3) are generally more stable for short SDXL runs. |
lam |
Ridge regularization strength ( |
window_size |
Initial forecasting window size (number of skipped steps). |
flex_window |
Increment added to the window after each actual UNet pass. Higher values result in aggressive acceleration. |
warmup_steps |
Number of initial full-model steps before forecasting begins. Gives the model time to establish composition. |
stop_caching_step |
The exact step count where Spectrum stops accelerating and hands rendering back to the native UNet. Essential for recovering fine details. (e.g., If rendering 25 total steps, set to 22 to let the original UNet render the final 3 steps). Set to 100 to disable the guard for maximum speed. |
steps |
Additional manual passthrough of KSampler step count into the model forecaster (t_max / _taus normalization). Set to match your KSampler total steps for stable forecast accuracy and drift reduction. |
For the best balance of extreme speed and high-definition sharpness (no blur/artifacts), use the following configuration (assuming a standard 25-step generation):
w:0.30m:3lam:0.1window_size:2flex_window:0.25warmup_steps:6(DiT models need higher warmup steps eg 8-10)stop_caching_step:22(Set this to Total Steps minus ~3)
Adjust flex_window higher if you want to push speeds further, or lower if you notice structural degradation.
This node implements ideas from the paper:
Adaptive Spectral Feature Forecasting for Diffusion Sampling Acceleration Jiaqi Han, Juntong Shi, Puheng Li, Haotian Ye, Qiushan Guo, Stefano Ermon Stanford University & ByteDance
- Paper: https://arxiv.org/abs/2603.01623
- Project Page: https://hanjq17.github.io/Spectrum/
- Official Code: https://github.com/hanjq17/Spectrum
If you use this node in your research, please cite the original paper:
@article{han2026adaptive,
title={Adaptive Spectral Feature Forecasting for Diffusion Sampling Acceleration},
author={Han, Jiaqi and Shi, Juntong and Li, Puheng and Ye, Haotian and Guo, Qiushan and Ermon, Stefano},
journal={arXiv preprint arXiv:2603.01623},
year={2026}
}









