ComfyUI Node

log10

Base-10 logs for when you're thinking in magnitudes

By StableLlama·Created about a year ago·Updated 4 days ago· 48
log10
  • value
  • FLOAT

log10 answers a very specific question: "how many powers of ten is this number?" log10(100) is 2, log10(1000) is 3, log10(10) is 1. Where its sibling log defaults to the natural base e, this node is the human-friendly, base-10 version - the one that matches how you actually think about "orders of magnitude."

In ComfyUI terms, it's the scale-compression tool. If you're working with values that range over several orders of magnitude - noise levels, distance scales, intensities - a linear number line makes everything either 0 or huge. log10 folds that range into something you can schedule, compare, or visualize.

How it works

A thin wrapper around Python's math.log10(). One input, one output:

  • value - the number to take the log of (FLOAT or INT, default 1, enforced minimum 0.0000001).
  • FLOAT output - the base-10 logarithm.

The outputs behave exactly like you'd expect: log10(1) = 0, log10(10) = 1, log10(0.1) = -1. Any power of ten is an integer, everything else lands between, and values below 1 go negative.

The one real trap

Same domain rule as log: zero and negatives are undefined. The input widget's min stops you typing something bad, but a wired-in value can still drift to 0 or negative at runtime and the node will die with a Python math domain error. This is the classic gotcha with every log node in every program ever, so don't feel bad when it happens - just clamp the input before it arrives. If your input can genuinely hit zero, add an epsilon: max(value, 1e-9) in a MathFormula node, then feed the result here.

Why not just use log with base 10?

You can - the log node has a base input. But log10 is the clearer choice when base 10 is the whole point, and it avoids accidentally leaving the default natural base on the log node and wondering why your "order of magnitude" math is all wrong. Two nodes, same pack, one responsibility each. That's the whole design philosophy of Basic data handling in a nutshell.

Installing it

Dependency-free pack, so the install is one line of thought: ComfyUI Manager → search "Basic data handling" → install → restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling

Restart and it's under Basic/maths.

Honestly, log10 is a niche pick - you'll grab it the day you're compressing a multi-order-of-magnitude range, and you'll appreciate it then. Until that day, file it under "nice to know it exists."

CategoryBasic/maths

Inputs (1)

NameTypeDefaultDescription
valueFLOAT,INT1

Outputs (1)

NameTypeDescription
FLOATFLOAT