Nodes/RES4LYF/Sigmas KernelSmooth
ComfyUI Node Runs on cloud

Sigmas KernelSmooth

Smooth out a jagged noise schedule

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
Sigmas KernelSmooth
  • sigmas
  • SIGMAS
kernelgaussian
kernel_size5
sigma1.0

This is one of the more genuinely useful nodes in RES4LYF's sigma toolbox, and it's a familiar technique borrowed straight from signal processing: kernel smoothing. If you've ever applied a moving average to noisy data, this is the more general version of that - instead of a flat average, you pick a weighting shape (the "kernel") and blend each value with its neighbors according to that shape.

Why you'd want to smooth a sigma schedule

Chain enough sigma-math nodes together - a hand-built curve, a chaotic transform, a couple of arithmetic operations stacked up - and you can end up with a schedule that's technically valid but jagged: small jumps and dips from step to step that don't reflect anything meaningful, just artifacts of whatever math produced them. A sampler stepping through a jagged schedule can produce visible seams or inconsistent detail at those rough spots. Sigmas KernelSmooth is the fix: it averages out that local noise while (depending on the kernel and window size) preserving the schedule's overall shape.

The five kernel shapes

  • gaussian (default) - weights neighbors by a bell curve, most influence from the closest points, tapering smoothly.
  • box - a flat, equal-weight average across the window. The simplest, bluntest version.
  • triangle - linearly decreasing weight from the center outward. A middle ground between box and Gaussian.
  • epanechnikov - a parabolic weighting, commonly used in statistics for kernel density estimation; similar spirit to Gaussian but with hard cutoffs at the window edge instead of a smooth tail.
  • cosine - weights follow a cosine taper, smooth like Gaussian but bounded within the window.

The inputs and outputs that matter

  • sigmas (SIGMAS, required) - the schedule to smooth.
  • kernel (enum: gaussian, box, triangle, epanechnikov, cosine; default gaussian) - the weighting shape.
  • kernel_size (default 5, range 3–51, odd values only) - how many neighboring steps each point's smoothed value draws from. Bigger windows smooth more aggressively but blur away more of the schedule's actual shape.
  • sigma (default 1, range 0.1–10) - the kernel's own spread parameter (most relevant to gaussian, epanechnikov, cosine), controlling how tightly weight concentrates near the center of the window.

Output is a single SIGMAS list, the same length as the input, smoothed.

When to actually reach for this

Right after any chain of sigma-math nodes that could've left jagged edges - the same "add it as a habit, not a last resort" logic as Sigmas Cleanup, just addressing shape instead of the floor. If your schedule is coming from a single, well-behaved scheduler and you haven't done anything unusual to it, you probably don't need this. If you've been layering Sigmas2 Add, chaos generators, or any of the pack's reshaping nodes, it's cheap insurance.

How to install it

  • ComfyUI Manager - search "RES4LYF", install, restart.
  • Manual - activate your venv, cd ComfyUI/custom_nodes && git clone https://github.com/ClownsharkBatwing/RES4LYF, cd RES4LYF, pip install -r requirements.txt (portable builds: use the embedded pip.exe). Restart.

Common issues & troubleshooting

Too large a kernel_size flattens the schedule's real shape, not just its noise. If your carefully-built curve starts looking like a generic smooth ramp after this node, back the window size down - you've smoothed past the point of removing artifacts and started erasing the actual design.

It doesn't fix a floor or negative values, only local roughness. Pair it with Sigmas Cleanup if your schedule also has out-of-range values near zero - kernel smoothing alone won't clamp those.

Near the ends of the schedule, the window has fewer real neighbors to draw from, so behavior at the very first and last few steps can differ from the smoothly-averaged middle. If the tail of your schedule looks off after smoothing, that boundary effect is the likely cause.

CategoryRES4LYF/sigmas

Inputs (4)

NameTypeDefaultDescription
sigmasSIGMAS
kernelCOMBOgaussian5 options: gaussian, box, triangle, epanechnikov, cosine
kernel_sizeINT53–51
sigmaFLOAT1.00.1–10

Outputs (1)

NameTypeDescription
SIGMASSIGMAS