ComfyUI Node

Floor

Round Down, and the Negative-Number Trap That Gets Everyone Once

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Floor
  • value
  • result

UC_MathFloor rounds a number down to the nearest whole number. 2.9 becomes 2, 3.1 becomes 3, and -2.3 becomes… -3, which is where people's eyebrows start moving. It's the "no more than this many" node, and once you know the negative-number quirk it behaves exactly as advertised.

Why you'd reach for it

Floor is the mirror of ceil: when something can't exceed a whole-number budget, you floor it. Tile counts you want to fit inside a canvas, batch sizes you don't want to overshoot, or chunking logic where a partial chunk should be dropped rather than padded. It's also the natural partner in a two-node pair: floor for "how many complete tiles fit," ceil for "how many tiles I need anyway." ComfyUI core doesn't ship a standalone floor node, so this is one of those small utilities that earns its place just by existing.

How it works

A straight math.floor(value) call. Input accepts int or float through the pack's MatchType template; output is hard-typed INT, since the whole point is a whole number. Wire it directly into any INT-only widget without a conversion node.

The one input that matters

value. One in, one result out. Nothing to configure, nothing to forget.

Installing it

Ships in ComfyUI-UtilsCollection. ComfyUI Manager → search "ComfyUI-UtilsCollection" → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection

Restart. No models; only opencv-python and typing-extensions in requirements.

The trap, spelled out

Floor rounds toward negative infinity, not toward zero. So floor(-2.3) is -3, not -2. That's the standard math definition, and it's correct, but it surprises anyone who learned "round down" as "chop off the decimal" (that's truncation, which is what UC_MathNumberConvert's int() output does). The practical consequence: for negative values, floor can go further from zero than you expected, and a negative result feeds a resolution or step count, you get a confusing error. The same behavior applies to UC_MathCeil in reverse. If you're migrating an old ComfyUI-LogicMath workflow, this node replaces LogicMath's floor - accept the swap and uninstall the old pack. Simple node, two-second mental model, and now you know the one gotcha.

Categoryutils/math

Inputs (1)

NameTypeDefaultDescription
valueCOMFY_MATCHTYPE_V3

Outputs (1)

NameTypeDescription
resultINT