Sigmas If
Pick per-step between two schedules based on a condition
- condition_sigmas
- true_sigmas
- false_sigmas
- SIGMAS
Most of RES4LYF's sigma-math nodes apply one fixed operation across an entire schedule. Sigmas If is different - it's a conditional, an elementwise ternary that picks between two candidate schedules step by step based on a comparison. If you've written any code, this is exactly the condition ? true_value : false_value pattern, just running once per step on three SIGMAS lists instead of once on three numbers.
How it works
For each position in the schedule, it compares the value in condition_sigmas against threshold using whatever comp_type you chose (greater, less, equal, or not_equal). If the comparison is true at that step, the output takes the value from true_sigmas at that position; if false, it takes the value from false_sigmas. The three input schedules drive the decision and supply the two possible outputs, but they don't have to be related to each other mathematically - condition_sigmas is purely a gate.
The inputs and outputs that matter
condition_sigmas(SIGMAS, required) - the schedule whose values get compared againstthresholdto decide, step by step, which branch wins.true_sigmas(SIGMAS, required) - supplies output values where the condition is true.false_sigmas(SIGMAS, required) - supplies output values where the condition is false.threshold(default0.5, range -10000 to 10000) - the comparison point.comp_type(enum:greater,less,equal,not_equal; defaultgreater) - howcondition_sigmasis compared againstthreshold.
Output is a single SIGMAS list, assembled step by step from true_sigmas and false_sigmas.
When this is actually useful
Unlike a lot of this pack's more exotic sigma-math nodes, the mechanism here is completely unambiguous, and there's a genuinely reasonable use for it: building a schedule that switches character partway through, without the abruptness of a hard split. A common setup is feeding the same schedule (or step-index-based values) into condition_sigmas, using threshold as the switchover point, and wiring one curve (say, something smooth and conservative) as true_sigmas for the early steps and a different curve (more aggressive, or a specific reshaping-node output) as false_sigmas for the late steps - effectively a scriptable version of what Sigmas Split plus a chain-sampler setup does with two separate samplers, but as a single merged schedule instead.
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
All three schedules need to line up in length. Since the comparison and the branch selection both happen position by position, feeding in schedules of different lengths (or built from different step counts) is going to produce undefined or misaligned results. Build condition_sigmas, true_sigmas, and false_sigmas from the same step count.
equal is a fragile comparison for floating-point sigma values. Two sigmas that look identical on paper are rarely bit-identical after going through any math node upstream, so equal/not_equal will behave less predictably than greater/less. Prefer greater or less with a deliberate threshold unless you have a specific reason to test for exact equality.
The output can jump abruptly at the switchover point if true_sigmas and false_sigmas don't meet at similar values there - that discontinuity is a real jump in noise level a sampler will notice. Check the result with a preview and, if the seam is visible, smooth it with Sigmas KernelSmooth before it reaches your sampler.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| condition_sigmas | SIGMAS | — | |
| true_sigmas | SIGMAS | — | |
| false_sigmas | SIGMAS | — | |
| threshold | FLOAT | 0.50-10000–10000 | — |
| comp_type | COMBO | greater | 4 options: greater, less, equal, not_equal |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SIGMAS | SIGMAS | — |