Nodes/RES4LYF/Sigmas If
ComfyUI Node Runs on cloud

Sigmas If

Pick per-step between two schedules based on a condition

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
Sigmas If
  • condition_sigmas
  • true_sigmas
  • false_sigmas
  • SIGMAS
threshold0.50
comp_typegreater

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 against threshold to 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 (default 0.5, range -10000 to 10000) - the comparison point.
  • comp_type (enum: greater, less, equal, not_equal; default greater) - how condition_sigmas is compared against threshold.

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 embedded pip.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.

CategoryRES4LYF/sigmas

Inputs (5)

NameTypeDefaultDescription
condition_sigmasSIGMAS
true_sigmasSIGMAS
false_sigmasSIGMAS
thresholdFLOAT0.50-10000–10000
comp_typeCOMBOgreater4 options: greater, less, equal, not_equal

Outputs (1)

NameTypeDescription
SIGMASSIGMAS