Number2Float_AS
When an integer won't plug into a float socket, this is the shim
- value
- FLOAT
Number2Float_AS takes a number on the left and outputs a FLOAT on the right. The value passes through untouched - no conversion happens at the data level, because ComfyUI's number type is already "either an int or a float." What this node actually does is relabel the connection so it fits a strict float socket. It's a type adapter, not a calculator.
It's part of flyingshutter's As_ComfyUI_CustomNodes, a dependency-free playground pack. No models, no extra installs.
How it works
The number type is ComfyUI's loose numeric type - both INT and FLOAT sockets can feed it, and it accepts whatever numeric value arrives. This node's output is declared as FLOAT, so the value (int or float) is passed through and presented as a float to whatever it connects to. Under the hood it's a one-line passthrough: value in, value out, with a different type label on the output port.
That distinction matters: it doesn't round, truncate, or coerce. If you feed it the integer 3, the downstream node receives the value 3 (presented as float). If you feed it 3.14159, it receives 3.14159. It's purely about making the socket connection legal.
The inputs
value- anynumber(int or float). Output:FLOAT.
That's the whole node. If you need the opposite direction, Number2Int_AS from this pack does the int side (and that one does round, because an int output can't represent a fraction).
Where you'd use it
The standard pain it solves: you've got an integer coming out of a seed node, a counter, or an int-returning custom node, and you need to feed a float-only parameter like a denoise strength, a CFG scale, or a LoRA weight - and ComfyUI refuses the direct connection because int ≠ float. Drop this node in between and the wire connects. It's also a cleaner alternative to dragging a primitive into your graph just to change a type.
It's the kind of node that's useless 95% of the time and absolutely the difference between a working and a broken workflow the other 5%.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/flyingshutter/As_ComfyUI_CustomNodes
Restart ComfyUI and it's under ASNodes (or ComfyUI Manager → "As_ComfyUI_CustomNodes"). No extra dependencies.
Common issues
- Expecting it to convert. It doesn't convert, it relabels. An int stays an int value-wise; it just presents as a float to the type checker. If you needed a true float with fractional precision, the precision was never there to begin with.
- Using it to fix a value problem. If your issue is that the number is wrong (too big, negative, out of range), a type adapter won't help. Fix the value upstream.
For a one-line type shim, there's genuinely not much more to say. It does one boring, important thing.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | number | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |