Number
Nine derived values from one float
- float
- int
- absolute
- round
- ceil
- floor
- sqrt
- exp
- log
Feed Number one float and it hands you nine pre-computed relatives: truncation, absolute value, rounding, ceiling, floor, square root, exponential, and logarithm. It's the "breakdown" node of FairLab's logic pack - one source value, and whatever transformation you need is already there on a socket instead of a chain of math nodes.
This is plumbing in the best sense. Say you have a scale factor of 2.0. From that single number you can wire sqrt into a resolution node, ceil into a batch count that must be a whole number, and abs somewhere you need a magnitude without a sign. In stock ComfyUI each of those is either a Primitive you retype or a math node you add. Here it's one node that fans out.
Inputs and outputs
number(FLOAT) in → nine outputs:float,int,absolute,round,ceil,floor,sqrt,exp,log.
Heads up, because the schema is genuinely confusing here: the first two outputs are mislabeled in a way that can bite you. The output named float is typed INT and the one named int is typed FLOAT - and per the source, both carry the truncated integer value. So if you grab the socket that says "int" expecting an int, you'll actually get a float, and vice versa. The remaining seven are plain FLOATs holding the math you'd expect: round/ceil/floor from the standard library, then sqrt, exp, and log.
How it works
Straightforward Python: it truncates to int, casts back, then applies abs, round, ceil, floor, sqrt, exp, log to the float. The one quirk beyond the label swap is that exp and log are natural (base e), not base 10 - fine for most uses, just don't assume log means log10.
Where it fits
Anywhere one number needs to become several differently-shaped numbers. It's the node you reach for when you catch yourself building a mini-calculator out of separate nodes. Just be aware of the swapped first two sockets before you wire them somewhere type-sensitive.
Install
FairLab installs as a single pack via ComfyUI Manager (search ComfyUI-FairLab) or:
cd ComfyUI/custom_nodes
git clone https://github.com/yanhuifair/ComfyUI-FairLab.git
cd ComfyUI-FairLab
pip install -r requirements.txt
Restart after. This node needs no extra dependencies. You'll find it under Fair/logic.
Gotchas
expandlogare natural (base e), not base 10. If you need base-10 log, divide bylog(10)- or just reach for Python Script andRESULT = ..., keeping in mind that one also can't importmath.- The
float/intlabel swap is real and worth remembering - it's the one genuinely surprising thing about an otherwise predictable node.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| number | FLOAT | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| float | INT | — |
| int | FLOAT | — |
| absolute | FLOAT | — |
| round | FLOAT | — |
| ceil | FLOAT | — |
| floor | FLOAT | — |
| sqrt | FLOAT | — |
| exp | FLOAT | — |
| log | FLOAT | — |