Nodes/RES4LYF/Sigmas Math3
ComfyUI Node Runs on cloud

Sigmas Math3

Write your own sigma-schedule formula

By ClownsharkBatwing·Created 2 years ago·Updated 17 days ago· 1,222
Sigmas Math3
  • a
  • b
  • c
  • SIGMAS
  • SIGMAS
  • SIGMAS
start0
stop0
trim0
x1.00
y1.00
z1.00
f1s
rescale1false
max114.61
min10.03
f2s
rescale2false
max214.61
min20.03
f3s
rescale3false
max314.61
min30.03

Most of RES4LYF's sigma nodes do one specific thing to a schedule. Math3 does whatever you tell it to. It's a three-slot formula evaluator: feed it up to three sigma schedules and three scalar numbers, write an expression for each of up to three outputs, and it computes them. If you've ever wanted to blend two schedules together, scale one by a curve none of the presets produce, or bolt together a shape that doesn't exist yet in this pack, this is the escape hatch.

That flexibility is also the catch. There's no dropdown of presets here - you're writing math against variable names. If typing an expression by hand isn't your idea of a good time, skip this node and reach for one of RES4LYF's named transforms (SmoothStep, Percentile, Resample) instead; each does one understandable thing with sliders. Math3 is for when none of them cover what you're actually trying to build.

How it works

You can wire up to three SIGMAS schedules into the optional a, b, c inputs - none are required, only wire in what your formulas reference - and set three scalar knobs, x, y, z, that those formulas can also use. Each of the three output slots gets its own formula string, f1, f2, f3; the default for all three is just "s", which passes the schedule straight through unchanged. start, stop, and trim control which slice of steps the node actually operates over - trim (negative-only) lops steps off the tail, useful when a formula misbehaves right at the end of a schedule, the point closest to zero noise where numerical weirdness tends to show up first.

Each output can optionally be rescaled back into a fixed range once the formula's run: flip rescale1/2/3 on and set the matching min/max pair, and the result gets linearly stretched to fit. The defaults there - 0.0291675 and 14.614642 - aren't arbitrary; that's the floor and ceiling SD1.5's own default schedule uses. If your formula's output drifts somewhere strange, rescaling snaps it back into territory a sampler actually expects.

The inputs and outputs that matter

For a first attempt, you mostly need one SIGMAS input (say, a), a formula in f1 that references it, and rescale1 left off until you've confirmed the shape looks sane. All three outputs are SIGMAS - wire whichever ones you actually used into a sampler, or chain them into another Sigmas- node for further processing.

Installing it

Through ComfyUI Manager, search RES4LYF and install, then restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF/
cd RES4LYF
pip install -r requirements.txt

(on a portable install, use the embedded python_embedded\Scripts\pip.exe instead of plain pip). Restart ComfyUI and hard-refresh the page.

Where people get tripped up

The formula syntax isn't documented anywhere beyond the node itself, and there's no community writeup of exactly what it accepts - treat this as an experimental power tool, not something with an established recipe. Start with the identity formula (s), confirm you understand what a actually looks like in your graph, then change one thing at a time rather than writing a complex expression cold.

The other trap is schedule length. If your formula (or your start/stop/trim slice) changes how many steps the output has, you can end up feeding a sampler a schedule shorter or longer than its step count assumes - which tends to show up as an outright error or a truncated-looking generation, not a message that points back at this node. If something downstream breaks after adding Math3 to a graph, check the step count coming out of it before you go looking anywhere else.

CategoryRES4LYF/sigmas

Inputs (21)

NameTypeDefaultDescription
startINT00–10000
stopINT00–10000
trimINT0-10000–0
aoptSIGMAS
boptSIGMAS
coptSIGMAS
xoptFLOAT1.00-10000–10000
yoptFLOAT1.00-10000–10000
zoptFLOAT1.00-10000–10000
f1optSTRINGs
rescale1optBOOLEANfalse
max1optFLOAT14.61-10000–10000
min1optFLOAT0.03-10000–10000
f2optSTRINGs
rescale2optBOOLEANfalse
max2optFLOAT14.61-10000–10000
min2optFLOAT0.03-10000–10000
f3optSTRINGs
rescale3optBOOLEANfalse
max3optFLOAT14.61-10000–10000
min3optFLOAT0.03-10000–10000

Outputs (3)

NameTypeDescription
SIGMASSIGMAS
SIGMASSIGMAS
SIGMASSIGMAS