Nodes/RES4LYF/Sigmas Logarithm2
ComfyUI Node Runs on cloud

Sigmas Logarithm2

Compress a noise schedule with a base-2 log

By ClownsharkBatwing·Created 2 years ago·Updated 22 days ago· 1,222
Sigmas Logarithm2
  • sigmas
  • SIGMAS
handle_negativetrue
epsilon0

Sigmas Logarithm2 applies log₂ - logarithm base 2 - to every value in a noise schedule. It's one of the more mechanically simple nodes in RES4LYF's sigma-math toolbox: a single well-known math operation, with a couple of settings that exist purely to keep that operation from blowing up on real-world input.

What a log transform does to a curve

Logarithms compress large values much more than small ones - the gap between a sigma of 10 and 12 shrinks a lot more under log₂ than the gap between 0.1 and 0.12 does. Applied across a full schedule, that means the steep, high-noise early steps get squashed together while the low-noise tail is comparatively preserved. That's the opposite instinct from a lot of schedulers, which concentrate effort (not raw values) toward the low-noise end - so this is a genuinely different kind of shape than Karras or beta57 produce, not a variant of them.

Why the epsilon and the negative-handling switch exist

Logarithms are undefined at zero and for negative numbers - log₂(0) is negative infinity, and log₂ of a negative value isn't a real number at all. Both are real risks with a sigma schedule: many schedules end at or near zero, and a schedule that's been through some other math node upstream (this pack has plenty that can produce negative values) might dip below zero too.

The inputs and outputs that matter

  • sigmas (SIGMAS, required) - the schedule to transform.
  • handle_negative (default true) - some strategy for dealing with negative input values (most plausibly taking the absolute value, or clamping to a small positive number, before the log) rather than letting them produce NaN or a complex result.
  • epsilon (default 1e-10, range 1e-15–0.1) - a tiny floor added before the log to avoid the log(0) singularity.

Output is a single SIGMAS list.

Should you use this?

The mechanism is clear enough that this one doesn't need much hedging, unlike some of the pack's stranger transforms - but I still found no documented recipe or community report of it being used to improve a real generation. It's plausible territory to explore if you specifically want to compress a schedule's high-noise range without touching its low-noise tail much, which none of RES4LYF's named schedulers do in quite this way. Just know you're exploring, not following a known technique.

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

No normalize_output option here, unlike most of this pack's other math-transform nodes. A log-transformed schedule will be in a very different numeric range than the input - small sigmas near zero become large negative numbers under log₂. Expect to need a separate rescale step (Sigmas InvLerp, or a manual Sigmas Mult/Sigmas Add) afterward if you want the result back in a range your sampler can actually use.

If you're still getting NaNs despite handle_negative and epsilon, check whether your input schedule has values at exactly 0 after some upstream operation - even with a floor epsilon, extremely small or zero values right at the boundary can behave unpredictably depending on how the floor is applied. Run Sigmas Cleanup before this node if you suspect that's happening.

This compresses values, it doesn't reorder them - a monotonically decreasing input stays monotonically decreasing after log₂ (logarithm is a strictly increasing function), so you won't get the schedule-shape breakage that some of this pack's other math nodes can produce. That's one thing you don't have to double-check here.

CategoryRES4LYF/sigmas

Inputs (3)

NameTypeDefaultDescription
sigmasSIGMAS
handle_negativeBOOLEANtrue
epsilonFLOAT01e-15–0.1

Outputs (1)

NameTypeDescription
SIGMASSIGMAS