Sigmas Fmod
Wrap a noise schedule into a repeating sawtooth
- sigmas
- SIGMAS
fmod is the floating-point version of the modulo operator: fmod(x, divisor) returns the remainder after dividing x by divisor, keeping the sign of x. Apply that to every value in a sigma schedule and the effect is a wraparound - instead of a smooth curve trending toward zero, you get a sawtooth, where any sigma value that exceeds divisor gets folded back into a smaller remainder. It's one of the more mechanically clear nodes in RES4LYF's sigma-math toolbox, unlike some of its stranger siblings, but that doesn't mean anyone's documented what it's actually good for on a real generation.
How it works
For every value in the input sigmas, the node computes value mod divisor and writes that back as the output value at the same position. Any sigma smaller than divisor passes through unchanged (its remainder is itself); anything larger gets chopped down into the [0, divisor) range, repeatedly if it's a large multiple.
The inputs and outputs that matter
sigmas(SIGMAS, required) - the schedule to wrap.divisor(default1, range 0.0001–10000) - the wrap point. Sigmas above this get folded back down modulo this value.
Output is a single SIGMAS list.
Should you use this?
I don't have a documented recipe for it, and I couldn't find one in the community record either - RES4LYF's exotic sigma-math nodes (this one, Sigmas Frac, the arc-trig and hyperbolic reshaping tools) are conspicuously absent from workflow shares and troubleshooting threads, even in posts where people are actively hand-tuning custom schedules. What's worth knowing going in: a schedule that wraps around introduces sudden jumps back up to a high sigma value after a low one, which is the opposite of what a sampler expects (steadily decreasing noise). That could be an interesting deliberate effect - a way to inject "re-noising" moments partway through a run without a full unsample/resample pass - but nothing confirms that's what people actually use it for, so treat it as raw experimentation material rather than a technique with a known payoff.
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 embeddedpip.exe). Restart.
Common issues & troubleshooting
A low divisor produces a lot of wraps. If most of your schedule's values sit well above divisor, expect a busy sawtooth rather than a gentle nudge - start with a divisor close to or above your schedule's actual peak sigma if you want a subtler effect.
The output isn't monotonic, by design. A sampler generally wants noise to decrease step over step; fmod will happily reintroduce a jump back up whenever a value crosses a multiple of divisor. If your render comes out visibly broken or over-noised at specific points, that's the wraparound doing exactly what it's built to do - dial divisor up until the jumps disappear, or drop this node from the chain.
Pair it with a preview before you commit a full render. A sigmas-preview node or Sigmas Count will show you the wrapped shape cheaply; there's no reason to burn a full generation finding out divisor was too aggressive.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| sigmas | SIGMAS | — | |
| divisor | FLOAT | 1.000.0001–10000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SIGMAS | SIGMAS | — |