Nodes/Nukun_ComfyUI_Nodes/SPEED Sampler (Nukun)
ComfyUI Node

SPEED Sampler (Nukun)

Denoise small, expand to full res along the way

By OnekoSL·Created 3 months ago·Updated 11 days ago· 1
SPEED Sampler (Nukun)
    • SAMPLER
    base_samplereuler
    transformdct
    modedelta_optimal
    model_presetflux
    scales0.5,1.0
    delta0.010
    manual_sigmas0.85
    spectrum_A203.615
    spectrum_beta1.915
    seed0

    SPEED is a training-free sampling trick: start denoising at a lower latent resolution and spectrally expand to full resolution during the trajectory, instead of denoising at full res the whole time. Fewer pixels early on, same pixels at the end - that's where the runtime win comes from, and it's why this node exists. It's an adaptation of the MIT-licensed howardhx/speed project (Spectral Progressive Diffusion for Efficient Image and Video Generation), implemented directly in this pack with no separate ComfyUI-SPEED install needed.

    The honest caveat up front: it's a speed/quality trade, and the README says it plainly - use it when your workflow is sampler-bound and you can inspect results for artifacts; use a normal sampler when exact stability matters more than speed. On FLUX-class T5 models the spectral expansion is generally well tolerated; on pickier bases you'll see resolution-jump artifacts.

    How it works

    The node outputs a SAMPLER for SamplerCustomAdvanced. Instead of replacing the sampler math outright, it wraps the chosen base_sampler (default euler) and runs it over a schedule of scale ratios. The key inputs:

    • transform - dct (default), fft, or dwt. dct is the safest for arbitrary scale ratios; fft also accepts arbitrary ratios; dwt requires each adjacent scale jump to be exactly 2× (like 0.25,0.5,1.0).
    • mode - delta_optimal (default) computes transition timing from the spectrum; manual uses your manual_sigmas list.
    • model_preset - flux, wan21, anima_manual, or custom. This sets the spectrum parameters (spectrum_A, spectrum_beta) that drive when each scale activates.
    • scales - comma-separated scale ratios, must end at 1.0. Default 0.5,1.0.
    • delta - the optimality parameter (default 0.01), must be < 1.0.

    The two cryptic floats, spectrum_A (default 203.615097) and spectrum_beta (1.915461), are the flux preset's power-spectrum constants - you only touch them under custom.

    • General/FLUX: dct, delta_optimal, flux, scales=0.5,1.0, delta=0.01.
    • WAN 2.1-style experiments: same, but model_preset=wan21.
    • Anima/manual: mode=manual, model_preset=anima_manual, scales=0.5,0.75,1.0, manual_sigmas=0.8,0.7.

    Installing it

    Standard pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/OnekoSL/Nukun_ComfyUI_Nodes.git
    

    Restart, or use Manager (search "Nukun"). The transform math needs scipy and PyWavelets, both already in the pack's requirements.txt. Wire the SAMPLER output into SamplerCustomAdvanced (or one of the pack's sampler nodes) and you're off.

    Common issues

    The validation errors are your friend here, and they're strict by design: scales must be strictly increasing and end at 1.0, delta must be < 1.0, manual_sigmas must be strictly decreasing in (0,1). The most common real-world failure is using dwt with non-2× jumps - it errors on purpose, so if you see "every scale must be in (0, 1]" or a dwt scale error, that's the fix. And don't expect a miracle: the speedup shows on large images and sampler-bound steps; on small canvases or already-fast samplers you may not notice, and you're paying a small artifact risk for nothing. A/B against your normal sampler before adopting it.

    CategoryNukun/Sampling

    Inputs (10)

    NameTypeDefaultDescription
    base_samplerCOMBOeulerUnderlying k-diffusion sampler used within each SPEED segment.
    transformCOMBOdctSpectral basis for expansion. DCT is safest for arbitrary scale ratios.
    modeCOMBOdelta_optimaldelta_optimal computes transition points; manual uses manual_sigmas.
    model_presetCOMBOfluxPower-spectrum preset. anima_manual is intended for manual mode.
    scalesSTRING0.5,1.0Comma-separated resolution scales ending at 1.0. Anima suggestion: 0.5,0.75,1.0.
    deltaFLOAT0.0100.0001–0.5Noise-dominated tolerance for delta_optimal mode. Smaller values transition later.
    manual_sigmasSTRING0.85Comma-separated decreasing sigma thresholds. Anima suggestion: 0.8,0.7.
    spectrum_AFLOAT203.6150–1000000Power-spectrum amplitude used with model_preset=custom.
    spectrum_betaFLOAT1.9150–10Power-spectrum decay exponent used with model_preset=custom.
    seedINT00–2147483647Seed for spectral-noise padding at each transition.

    Outputs (1)

    NameTypeDescription
    SAMPLERSAMPLER