Nodes/ComfyUI-CRZnodes/CRZ Float to Int
ComfyUI Node

CRZ Float to Int

The one-line converter that keeps sliders from yelling at INT sockets

By CoreyCorza·Created 12 months ago·Updated 12 months ago· 42
CRZ Float to Int
  • FLT
  • INT

CRZ Float to Int is a two-cent node that saves you from a five-minute headache, and once you've hit that headache you'll never delete it from a workflow again. ComfyUI is strict about types: a FLOAT output will not happily slide into an INT input, and half the "why won't this connect" posts on r/comfyui are that exact mismatch. This node takes a float in and hands an integer out, so you can drag a slider's value into a steps, seed, or batch_size socket without ComfyUI sulking at you.

It's part of ComfyUI-CRZnodes, the dashboard-node pack from CoreyCorza. In the README it's described, with the pack's usual understatement, as a "compact int-to-float / float-to-int" - these are the plumbing nodes that make the pretty dashboard widgets actually usable, because sliders mostly output FLOAT and the graph mostly wants INT.

How it works

The entire implementation is int(FLT). That's it - one cast, one output. But that cast has one behavior you should know about before it bites you: int() truncates, it doesn't round. So 3.9 becomes 3, and 3.1 becomes 3 too. If you slide to 4.7 expecting a steps value of 5, you'll get 4. For most ComfyUI inputs (steps, seed, frames) that truncation is fine, but if you genuinely need nearest-rounding, do the rounding upstream in whatever produces the float - or just nudge the slider.

The input is typed * (any), so you can feed it a FLOAT from a slider, an INT, or even a string that looks like a number. That's deliberate: the node is meant to sit between a dashboard control and whatever stubborn socket needs an integer.

The inputs and outputs

  • FLT (input) - the float you want to convert. Accepts any type and casts it.
  • INT (output) - the truncated integer. Wire it into any INT socket.

That's the whole schema. It's registered in the hidden __hidden__ category, which is why you won't see it cluttering your node menu - it's a supporting player for the dashboard nodes, not something you search for directly. If you see a "CRZ" node you didn't place, this is usually one of the invisible ones in a workflow you downloaded.

Installing it

It ships with the pack, so there's nothing extra to fetch: install ComfyUI-CRZnodes via ComfyUI Manager (search "CRZ") or clone it manually, then restart.

cd ComfyUI/custom_nodes
git clone https://github.com/CoreyCorza/ComfyUI-CRZnodes.git

There are no requirements or model downloads - the README says so in so many words.

When you'd reach for it

Honestly, the pair of converter nodes only exists because the pack's sliders output FLOAT by design, and the graph is full of INT-only inputs. Use it whenever you're connecting a CRZ Float Slider to something integer-y and ComfyUI refuses the wire. It's not a node you'll think about - it's a node you'll silently drop in, forget, and be grateful for when the graph just runs.

Category__hidden__

Inputs (1)

NameTypeDefaultDescription
FLT*

Outputs (1)

NameTypeDescription
INTINT