Sigmas Modulus
Wrap a sigma schedule with a remainder operation
- sigmas
- SIGMAS
A sigma schedule is normally a smooth, steadily falling curve - high noise at step one, near zero by the last step. Modulus takes that curve and runs every value through a remainder operation against a divisor you choose. Whatever was smoothly decreasing now wraps: every time a value crosses a multiple of the divisor, it snaps back up instead of continuing to fall. You get a sawtooth, not a slope.
Be clear-eyed about what that's for. This isn't something you drop into a normal single-pass generation and expect good results - a sampler expects noise to keep decreasing, and a sawtooth violates that assumption outright. It's a building block: something you reach for when you're deliberately constructing an unusual, cyclical noise pattern, or when you want to feed the wrapped output into a repair node (Percentile or QuantileNorm, say) as a step in a larger, hand-built pipeline. On its own, it's a curiosity more than a tool you'll use daily.
The inputs and outputs that matter
Two required inputs: sigmas, the schedule to wrap, and divisor (a FLOAT, default 1, range -1000 to 1000) - the value each sigma gets divided by, with the remainder kept. A larger divisor means fewer, wider wraps; a smaller one means the sawtooth cycles faster. The single output is SIGMAS, ready to wire into a sampler or chain into another sigma node.
If you're trying to decide whether you actually want this node: most people who think they want "modulus" really want periodicity within an otherwise sane schedule, not a raw wraparound feeding straight into a sampler. In that case, treat Modulus as step one of a two-step move - wrap the schedule here, then run it through Sigmas Percentile or Sigmas QuantileNorm to fold the result back into a range and shape a sampler can actually work with, rather than expecting the wrapped output to be usable on its own.
Installing it
ComfyUI Manager: search RES4LYF, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF/
cd RES4LYF
pip install -r requirements.txt
Portable builds use the embedded python_embedded\Scripts\pip.exe in place of pip. Restart and hard-refresh the browser tab afterward - a plain reload sometimes won't pick up new node registrations.
Where people get tripped up
Keep divisor away from zero - a remainder against zero is undefined, and nothing useful comes out the other side. More generally, if you wire this node straight into a sampler and get garbage - noisy, re-corrupted-looking output, or an outright crash - that's expected, not a bug: you've handed the sampler a schedule that goes back up partway through, which most samplers simply aren't built to handle. If you want the effect of modulus (a repeating structure) without breaking a normal pass, run the wrapped output through a rescale or normalization node afterward rather than feeding it in raw.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| sigmas | SIGMAS | — | |
| divisor | FLOAT | 1.00-1000–1000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SIGMAS | SIGMAS | — |