ComfyUI Node

Round

Round (RoundNode) — ComfyUI-LogicUtils

By aria1th·Created 3 years ago·Updated 7 months ago· 123
Round
  • input1
  • INT

Do any arithmetic in a ComfyUI graph and sooner or later you end up with a float where a whole number is required. Divide gives you 3.5. A scale factor lands you at 512.0000001. And the field you're trying to feed, a step count, a width, a batch size, wants a clean integer and will flat-out reject the wire. Round is the small fix for that: value in, nearest integer out.

That's really all it is, and that's why it's useful. It's the cleanup node you drop between a math operation and whatever consumes the result. The math family in this pack (Multiply, Divide, and friends) happily produces floats, and a lot of ComfyUI's important inputs are strictly integer. Round is the adapter that makes those two facts coexist.

It belongs to ComfyUI-LogicUtils, the utility grab-bag from aria1th, the handle behind AngelBottomless who trained Illustrious XL. The pack is a personal toolkit, not a product, with sparse docs, so nodes like this are deliberately minimal and you learn them by wiring them in.

Inputs and outputs

One input, input1, typed * (the wildcard, so it takes a number of any flavor). One output, and note this specifically: it's an INT. Round doesn't just tidy the decimal, it commits to an integer type on the way out, which is exactly what makes it drop cleanly into an integer-only field. Feed it 3.5, get 4; feed it 512.0000001, get 512.

There's nothing else to configure. No precision setting, no floor-versus-ceil choice. It rounds to the nearest whole number and hands you an integer.

Installing it

  • ComfyUI Manager: search "ComfyUI-LogicUtils" in Custom Nodes Manager, install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart.

No models, no big dependencies. There's an optional auto-installer for the pack's dependencies gated behind COMFYUI_LOGICUTILS_AUTO_INSTALL=1 (and COMFYUI_LOGICUTILS_SKIP_INSTALL=1 to force it off), but rounding a number needs none of it.

Worth knowing

Two small things. First, it rounds to the nearest integer, so if you actually need "always round down" or "always round up" behavior, this isn't quite it, and you'd want a floor or ceiling operation instead. For the common case of "make this float into a usable int," nearest-integer is exactly right.

Second, because the output is a hard INT, this is genuinely the fix for that annoying "cannot connect FLOAT to INT" error you hit when wiring a computed value into a sampler's step field or a latent's dimension. When ComfyUI refuses the connection, a Round in the middle almost always sorts it out. It's one of those nodes you don't think about until a wire won't take, and then it's the first thing you reach for.

CategoryMath

Inputs (1)

NameTypeDefaultDescription
input1*

Outputs (1)

NameTypeDescription
INTINT