Convert to Float
Cast any value into a float
- input1
- FLOAT
Type glue. It takes whatever you give it and turns it into a float. In ComfyUI the type of a wire is strict - a node that wants a FLOAT input won't accept a STRING or an INT no matter how much they look like numbers to you - and this node is the little adapter that makes those connections legal. Value goes in on a wildcard input, a proper float comes out.
You hit the need for this more than you'd expect. A string "7.5" read from a text field, an integer from a counter, a number that arrived as the wrong type from some other node - any of these might need to land in a float input (a CFG scale, a denoise strength, a ratio) and get rejected on the type mismatch. Drop this in between and the wire connects.
How it works
The input is typed as the wildcard *, which is how it accepts anything - string, int, float, whatever - rather than being locked to one source type. It parses that value to a float and emits it. A numeric string like "3.14" becomes 3.14; an int like 5 becomes 5.0. Standard cast, nothing exotic.
The input that matters
- input1 - the value to convert, on the flexible
*slot. Wire in your string, int, or other value here.
The output is a single FLOAT, ready for any float-typed input downstream.
The gotcha
It can only convert things that actually represent a number. Hand it a numeric string and you're golden; hand it "seven" or a chunk of non-numeric text and the underlying cast will fail with an error rather than guessing. So if this node throws, look at what you're feeding it - the fix is almost always upstream, cleaning the value before it reaches here (a ReplaceString to strip stray characters, for instance). It's a converter, not a parser that can read intent.
Installing ComfyUI-LogicUtils
ComfyUI Manager: Install Custom Nodes → search "ComfyUI-LogicUtils" → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils
Restart ComfyUI. No dependencies.
Worth knowing
The pack is aria1th's (AngelBottomless) undocumented utility set, and this is one of its plainest members - a one-input type cast. It exists for the same reason every "convert X to Y" node exists: ComfyUI's strict wire types occasionally need a nudge. Keep the input genuinely numeric and it just works; the only way it bites is a value that isn't a number in the first place.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input1 | * | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |