NumberToFloat
Cast ComfyMath's generic number to a real FLOAT
- FLOAT
This is the node you reach for at the end of a chain of ComfyMath math - you've been doing your calculations in the pack's own generic NUMBER type, and now you need to hand the result to something in the rest of ComfyUI that expects an honest-to-god FLOAT socket. NumberToFloat does exactly that one conversion.
It's a small utility node from ComfyMath, evanspearman's math/logic pack, and it exists because ComfyUI's type system is strict: a NUMBER output won't plug into a FLOAT input on its own, even though under the hood it's just a number. You need this node (or its sibling CM_NumberToInt) to bridge the two.
How it works
There's nothing to configure - feed a (NUMBER) in, and it comes out the other side as FLOAT, unchanged in value. It's a pure type cast, not a math operation.
This shows up in real workflows more than you'd guess. It's the kind of glue node people lean on when a value needs to travel through a few generic NUMBER-typed math steps and then land somewhere specific - a real example that surfaced in a shared LTX-2 workflow used exactly this kind of ComfyMath float/int conversion to get a framerate value into the shape a downstream video node wanted, without needing anything more elaborate than these two conversion nodes.
Inputs and outputs
a(NUMBER, default 0) - the generic-typed value to convert.- Output:
FLOAT- the same value, now as a concrete float socket.
How to install it
Through ComfyUI Manager: search ComfyMath, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/evanspearman/ComfyMath.git
then restart. No dependencies to install, nothing to download - just Python.
Common issues & troubleshooting
A downstream node still won't accept the output. Double-check it actually wants FLOAT and not INT - if the target is an integer socket (like a batch size or a seed field), use CM_NumberToInt instead, not this node.
You're not sure why you had a NUMBER value in the first place. Most of the time it's because it came out of one of ComfyMath's own Number* nodes (CM_NumberBinaryCondition, CM_NumberUnaryCondition, etc.) - those all operate on and return the generic NUMBER type rather than committing to int or float, which is convenient mid-chain but means you need a cast like this one whenever you exit that chain into the rest of your graph.
Missing node error on workflow load. Install ComfyMath via Manager as above, then reload.
The pack seems inactive. A 2024 community thread noted the original author had moved away from active development on ComfyMath. For a one-line type cast like this node, that's essentially irrelevant - there's no dependency to go stale and nothing about a plain conversion that needs ongoing maintenance.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| a | NUMBER | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |