KSampler (Spectrum for MOSS)
MOSS-Image's official sampler chain is three nodes. This is one — and it skips most of the blocks.
- model
- positive
- negative
- latent_image
- LATENT
What you're actually plugging in
If you've loaded a MOSS-Image model through the moss-image node, the official workflow makes you build the sampling side out of three stock nodes: ModelSamplingSD3 for the flow shift, SkipLayerGuidanceDiTSimple to skip block 22 on the negative branch, then a plain KSampler. Each one carries a number that has to match the MOSS pipeline or the output quietly degrades.
KSampler (Spectrum for MOSS) collapses all three into one node, with the pipeline's numbers already dialed in: shift 5, CFG 3 with block 22 skipped on uncond, 50 Euler steps on sgm_uniform. Then it bolts two accelerations on top that stock ComfyUI can't give you.
And it isn't a reimplementation of those nodes: the source imports ModelSamplingSD3 and SkipLayerGuidanceDiTSimple at sample time and calls them, then hands the patched model to common_ksampler. Same code path ComfyUI runs, fewer nodes to wire wrong.
The two accelerations, in plain terms
Spectrum is a training-free caching method - no distillation, no LoRA, no extra checkpoint. The premise: a transformer's block outputs change smoothly across timesteps, so you don't need to compute all of them every step. On "actual" steps the full DiT runs and the node captures the image tokens entering MOSS's head (final_norm_video). On "cached" steps it skips the text refiner and every transformer block, runs only the time embedding plus the head, and feeds that a prediction from a Chebyshev ridge-regression fit over the step index.
Cond and uncond get separate forecasters, which matters - the negative branch runs a different trajectory once block 22 is skipped. At 50 steps with the default flex_window = 0.5 you get 19 real forwards out of 50. Two safety rails are baked in rather than exposed: the first 6 steps and the last 3 always run full, because the tail is where fine detail gets decided and a bad forecast there costs more than it saves.
compile is the simpler of the two: torch.compile on each of diffusion_model.layers, inductor backend, dynamic shapes because MOSS never pads prompts. The author's bench on a 5070 Ti at 1024², 50 steps: stock three-node chain 68s, this node 25.9s with compile off and 21.2s with it on. The caching does most of the work; compile is the last 20%.
The inputs that matter
Most of the wire surface is a plain KSampler - model from the moss-image loader, plus positive, negative, latent_image, denoise, seed, steps, cfg. One output, LATENT, straight into VAE Decode. The widgets that are specific to this node:
shift(5.0) anduncond_skip_layers("22") - the two settings people forget.uncond_skip_layerstakes a comma-separated list of block indices; leave it empty for plain CFG. You'll do that if you're chasing a difference and want to rule the skip out.spectrum(on) andflex_window(0.5) - the caching. Higherflex_windowmeans the window between real forwards grows faster, so fewer forwards: at 50 steps, 0.25 / 0.5 / 1.0 give 22 / 19 / 16.spectrum = falsestill applies the shift, the skip and the compile, so it's a clean A/B against stock behavior.compile(on) - leave it on unless it fights you. See below.
euler on sgm_uniform is the pair MOSS ships with; don't wander far. Flow-matching DiTs run a near-straight trajectory, so reshaped schedules like karras distort rather than correct - a rule for the whole family, not a MOSS quirk. If you're changing one thing, change step count.
Installing it
No requirements.txt, no install.py, and pyproject.toml declares zero dependencies. Everything else it imports (comfy_extras.nodes_slg, comfy_api.torch_helpers) ships with ComfyUI itself.
cd ComfyUI/custom_nodes
git clone https://github.com/sorryhyun/ComfyUI-Spectrum-KSampler
# restart ComfyUI, then hard-refresh the browser
Or in ComfyUI Manager, search the pack title SpectrumKSampler. The node lands under sampling as "KSampler (Spectrum for MOSS)". You still need the separate moss-image pack and the MOSS-Image weights; this one only provides the sampler.
Where people get burned
The compile path costs RAM. A compiled model needs a non-dynamic-VRAM copy of the DiT, and the node keeps one per checkpoint in host RAM next to ComfyUI's own copy. Fine at 1024², less fine if you're already tight. Turn compile off first - you lose ~20% of the win, not the speedup.
Compile and dynamic VRAM loading don't get along. Compiled blocks break when the DiT gets re-staged mid-workflow, failing on mismatched shapes; the node clones a non-dynamic delegate to dodge that, but on a ComfyUI build too old to disable dynamic loading via clone() you'll get a logged warning and compile may fail. It also imports comfy_api.torch_helpers at sample time, which doesn't exist on old frontends. Same fix each time: toggle compile off. Nothing here is exotic without it.
Don't stack this with a fast-step LoRA. Every real forward teaches the forecaster something, so 50-step MOSS is the ideal case. Squeeze MOSS down to 8 distilled steps and there's nothing left to skip; the two accelerations fight over the same trajectory. Pick one.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | MOSS-Image MODEL (moss-image loader). | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 501–10000 | — |
| cfg | FLOAT | 3.00–100 | — |
| sampler_name | COMBO | euler | 45 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +39 |
| scheduler | COMBO | sgm_uniform | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| latent_image | LATENT | — | |
| denoise | FLOAT | 1.000–1 | — |
| shift | FLOAT | 5.000–100 | Flow shift (ModelSamplingSD3). MOSS pipeline: 5. |
| uncond_skip_layers | STRING | 22 | Blocks skipped on the uncond branch (comma-separated; empty = plain CFG). MOSS pipeline: 22. |
| spectrum | BOOLEAN | true | Spectrum feature forecasting. |
| flex_window | FLOAT | 0.500–2 | Spectrum window growth after each actual forward. At 50 steps 0.25 / 0.5 / 1.0 run 22 / 19 / 16 actual forwards. |
| compile | BOOLEAN | true | torch.compile each of the DiT's blocks (inductor, dynamic shapes). Compiles on the first sample; falls back to eager without a C++ compiler. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |