Spectrum Qwen Model Patcher
Make Qwen Image Edit stop recomputing the same 40 transformer blocks
- model
- MODEL
If you've sampled a Qwen Image Edit model, you know the pain: a huge transformer block stack that re-runs in full at every single step. This node skips most of it. Spectrum Qwen Model Patcher is a ComfyUI node that applies Spectrum - a real, training-free acceleration method from CVPR 2026 - to native Qwen Image-family models, with the primary target being Qwen-Image-Edit-2511. No API, no key, no fine-tuned weights, no model downloads. It's a patcher: you insert it between your loaded Qwen model and the KSampler, and it outputs a patched MODEL that samples faster.
What it actually does
Spectrum is the opposite of distillation. Distilled models (Lightning, Turbo, LCM) bake a compressed sampling trajectory into the weights, and you pay for it in quality and in rigid low-step settings. Spectrum keeps the original weights untouched and instead gets clever at inference time: run a few real denoising passes, capture the final hidden state right before the model's output head, fit a small polynomial forecaster over those recent states, then on skipped steps predict that hidden state and run only the cheap tail of the network.
For Qwen Image specifically, that tail is time_text_embed → norm_out → proj_out. The expensive part - the long transformer_blocks stack - gets bypassed on forecast steps. The patcher finds the native Qwen transformer core inside your loaded MODEL, hooks the forward pass, and captures the pre-norm_out image-stream hidden state on real steps. The forecaster is a ridge-regularized Chebyshev polynomial fit over the last few real steps, driven by a normalized step-position coordinate. Warmup, the final tail, and any unsupported case stay on the real path.
The inputs that matter
The node's inputs are all sliders, and the defaults are a sane conservative start. The ones worth touching:
warmup_steps(5) - how many initial steps run for real before forecasting starts. More warmup = cleaner result, fewer skipped passes. The author's own FLUX/SDXL testing shows this is your main quality dial.tail_actual_steps(2) - reserves the final steps as real forwards. Late-step forecast error shows up as lost microdetail, so protect the tail before you crank aggression.max_consecutive_forecasts(1) - max skips in a row before a forced refresh step. Keep it low to start.history_points(5) andchebyshev_degree(3) - how much history the fit uses and how fancy the polynomial is. Note the validation: degree must be smaller than history points.ridge_lambda(0.0001) - the ridge regularization. You can basically leave this alone.cache_device(main_device) - where hidden-state history is stored.cpusaves VRAM but can eat the speed win.force_actual_on_control(true) - keep this on. ControlNet residual injection isn't reconstructed by this port, so per-block control stays real.debug(false) - turn it on for your first run; it logs each step as actual vs forecast.
The single output is a patched MODEL, wired straight into your KSampler.
Installing it
ComfyUI Manager - search "Spectrum Qwen Model Patcher" or "ComfyUI-Spectrum-Qwen-Proper" and install. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-Spectrum-Qwen-Proper.git
Restart ComfyUI. That's the whole install: the requirements file is literally "no extra dependencies" - Python stdlib plus what ComfyUI already ships. No model files to fetch.
The honest gotchas
This is the newest of the author's Spectrum ports (there are siblings for FLUX, SDXL, WAN, and Z-Image under the same "Proper" naming), and the author shipped it saying he hadn't had time to test it. Treat it as experimental. Run debug = true first and confirm you're actually seeing forecast steps before you judge the quality.
Beyond that: it only works on native Qwen Image-family loaders that expose the standard core (img_in, transformer_blocks, norm_out, proj_out, time_text_embed). Quantized or Nunchaku-wrapped Qwen will error out at patch time - the node raises a clear ValueError rather than silently breaking. Speed LoRAs (Lightning/Turbo/LCM/DMD2) fight Spectrum: both try to reduce model evaluations, and a LoRA at its native low-step sweet spot leaves no room to forecast. And if ComfyUI changes the Qwen transformer internals, this node breaks until it's updated. Start with the conservative defaults, protect the tail, and compare outputs yourself - there's no quality oracle here.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| warmup_steps | INT | 50–64 | Number of initial solver steps forced to run as real Qwen forwards. |
| tail_actual_steps | INT | 20–32 | Number of final solver steps forced to stay on the real path. |
| history_points | INT | 52–16 | Number of real hidden-state snapshots kept for the Chebyshev fit. |
| chebyshev_degree | INT | 31–8 | Polynomial degree used by the ridge-regularized Chebyshev forecaster. |
| max_consecutive_forecasts | INT | 10–8 | Maximum number of skipped Qwen transformer passes allowed in a row before a real refresh step is forced. |
| ridge_lambda | FLOAT | 0.00010–1 | Ridge regularization strength used during the Chebyshev coefficient solve. |
| cache_device | COMBO | main_device | Where captured Qwen hidden-state history is stored for fitting and forecasting. |
| force_actual_on_control | BOOLEAN | true | Force real forwards when ControlNet/control residuals are present. Recommended. |
| debug | BOOLEAN | false | Log per-step mode decisions and a summary at the end of the run. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |