ComfyUI Node Runs on cloud

To Number

One wire to feed the arithmetic chain

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
To Number
  • value
  • number

Every node pack develops a type it secretly prefers for numbers, and WAS Node Suite's is the NUMBER wire - the one its own arithmetic, counters and comparisons run on. To Number is the bridge that lets anything else's numbers onto that wire without a conversion node in between.

What it is

The value input accepts an INT, a FLOAT or a BOOLEAN, and one number output comes out on the NUMBER socket:

  • A whole number passes through as-is.
  • A decimal passes through keeping its fraction - "so feed it to a node that rounds where a whole number is wanted" is the honest note in the tooltip.
  • A boolean becomes 1 for true, 0 for false.

That last conversion is quietly the most useful one. Switches, comparisons and condition nodes all produce booleans, and the arithmetic nodes want numbers. To Number is the one-node bridge from "which branch won?" to "count it," letting a flag join a Number Operation or feed a counter without extra plumbing.

When you'd reach for it

The WAS number family - Number Operation, Number Counter, the comparisons - is NUMBER-in/NUMBER-out, so any time a value arrives in a different shape, this is the adapter:

  • A To Boolean's true/false needs to become a 1/0 for arithmetic.
  • An image size, a latent dimension, a frame count (all INT or FLOAT from other packs) needs to feed a NUMBER-only math node.
  • Any INT you want to push into a Number Operation chain without hunting for a converter.

The real reason the node exists is friction removal. In ComfyUI's typed world, an INT and a NUMBER are different sockets, and graphs that mix them end up festooned with converters. This is the dedicated one for getting into this pack's numeric world, and once you've built a chain of Number Operations you'll see why it's there - those nodes won't take a raw INT, and this is the door in.

What it's not

It won't parse text - that's Text to Number's job (and the list variant is Text List to Numbers). It doesn't round or clamp anything. It's a pure type-shift for values that already are numbers or booleans, which is exactly as boring and exactly as reliable as it sounds. If you find yourself with a FLOAT that a NUMBER node keeps refusing, this is the fix, and it's a fix you'll use more than you'd expect.

Installing it

Part of WAS Node Suite v3 (WASasquatch's was-node-suite-comfyui, MIT). Search "WAS Node Suite v3" in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git

Restart ComfyUI after installing. Requires ComfyUI 0.14.0+ and Python 3.10+; no extra packages needed.

CategoryWAS Suite/Number/Operations

Inputs (1)

NameTypeDefaultDescription
valueINT,FLOAT,BOOLEANWhat to convert. A whole number and a decimal pass through as they are, and a switch becomes 1 for true and 0 for false.

Outputs (1)

NameTypeDescription
numberNUMBERThe same value on the NUMBER wire. A decimal keeps its fraction, so feed it to a node that rounds where a whole number is wanted.