Int → Float
The tiny fix for ComfyUI's strictest mismatch
- FLOAT
Every ComfyUI beginner eventually hits this: the seed node outputs an INT, and the node you're wiring it into wants a FLOAT, and the wire turns red. The classic first instinct is "there must be a conversion node" - and yes, here it is. SL_IntToFloat takes your integer and returns it as a float. 5 becomes 5.0. The value doesn't change, only its type.
Let me be honest about how often you actually need it. ComfyUI already lets INT wires plug into FLOAT inputs - widening a whole number to a float is lossless, so the runtime allows it silently. That means half the time you'd think you need this node, you don't; the wire just connects. Where it earns its keep:
- A node that demands a float output rather than just accepting a float input. Some custom nodes compute and output in a strict type, and feeding them an INT source produces a mismatch that auto-coercion doesn't solve.
- Keeping a chain consistently FLOAT so a downstream math node treats every operand identically (and avoiding any integer-division surprises if a node does something with that value).
- The NUMBER family: if your target declares a NUMBER input, an explicit float conversion makes the intent readable in the graph.
Mechanically it's float(value), one line, no rounding (there's nothing to round - integers are already whole). The output type is FLOAT, which then plugs into FLOAT and NUMBER ports alike.
Inputs and outputs:
value(INT) - the integer, default 0- Output:
FLOAT- same value as a float
Installing it
Part of ComfyUI-SimpleLogics. ComfyUI Manager → search "SimpleLogics" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/danipisca07/ComfyUI-SimpleLogics
Restart, Add Node → search "Int → Float" (menu group SimpleLogics/Convert). No dependencies, nothing to download.
Gotchas
- Usually skippable. Don't add nodes to your graph out of habit. Try the direct connection first - if it connects, this node adds nothing but visual noise.
- The reverse is the real problem. Converting float to int is where ComfyUI actually refuses to auto-coerce, and that's
SL_FloatToInt's job (note: it truncates, it doesn't round - 3.9 becomes 3). - If you need the int back later, you've added a pointless round trip. Keep conversions as late and as few as possible.
It's the quietest node in the pack and that's fine. When you need it, it's the difference between a red wire and a working graph, and it costs you nothing.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |