Sigmas Math3
Write your own sigma-schedule formula
- a
- b
- c
- SIGMAS
- SIGMAS
- SIGMAS
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.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| start | INT | 00–10000 | — |
| stop | INT | 00–10000 | — |
| trim | INT | 0-10000–0 | — |
| aopt | SIGMAS | — | |
| bopt | SIGMAS | — | |
| copt | SIGMAS | — | |
| xopt | FLOAT | 1.00-10000–10000 | — |
| yopt | FLOAT | 1.00-10000–10000 | — |
| zopt | FLOAT | 1.00-10000–10000 | — |
| f1opt | STRING | s | — |
| rescale1opt | BOOLEAN | false | — |
| max1opt | FLOAT | 14.61-10000–10000 | — |
| min1opt | FLOAT | 0.03-10000–10000 | — |
| f2opt | STRING | s | — |
| rescale2opt | BOOLEAN | false | — |
| max2opt | FLOAT | 14.61-10000–10000 | — |
| min2opt | FLOAT | 0.03-10000–10000 | — |
| f3opt | STRING | s | — |
| rescale3opt | BOOLEAN | false | — |
| max3opt | FLOAT | 14.61-10000–10000 | — |
| min3opt | FLOAT | 0.03-10000–10000 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| SIGMAS | SIGMAS | — |
| SIGMAS | SIGMAS | — |
| SIGMAS | SIGMAS | — |