2🐕Int Float Text Swap
One value, cast three ways at once
- Any_input
- Int
- Float
- Text
ComfyUI's type system is stricter than it looks at first glance. Sockets only connect to sockets of a matching color, and it's a routine annoyance that some node hands you a number as a STRING when the thing you want to plug it into expects an INT, or the reverse. Int Float Text Swap exists purely to get you out of that jam: plug in a value and it hands you back the same thing recast as an integer, a float, and a string, all at once, so you grab whichever socket color you actually need.
How it works
There's exactly one input, Any_input, typed as * - ComfyUI's wildcard type, meaning it'll accept a connection from more or less anything: a number, a string that looks like a number, whatever another node's output happens to be. It comes back out as three separate outputs - Int, Float, and Text - each also typed * on the node itself but meant to be read as an integer, a float, and a string representation of whatever you fed in. Wire whichever one matches what the downstream node is expecting.
What to actually set
Nothing, really - there's no widget to configure here. You connect an input and pick which of the three outputs you need. That's the whole node.
Installing it
ComfyUI Manager: search "Comfyui-ergouzi-Nodes", install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/11dogzi/Comfyui-ergouzi-Nodes.git
then restart ComfyUI. No models involved, nothing to download - it's a pure type-conversion utility. And the usual caveat for this pack: the English repo you're pulling from isn't where new nodes are being added anymore; that work continues on a separate, Chinese-first sibling repo.
Common issues & troubleshooting
One of the three outputs errors or gives a nonsense value. This is a conversion node, not a validation node - if you feed it text that isn't actually a number (a full sentence, say), the Int and Float outputs have nothing sensible to convert, and you'll see an error or a garbage value downstream. Only the Text output is guaranteed to behave for arbitrary input; the numeric outputs need the source value to actually be numeric, or at least a numeric-looking string.
The wildcard type doesn't connect where you expect. Because both the input and outputs are typed *, ComfyUI's UI is generally permissive about letting you wire it almost anywhere - which means it's on you to pick the correct one of the three outputs for the socket you're feeding, since the graph won't stop you from picking the wrong one and erroring at runtime instead of at connection time.
Beyond that, it's about as simple as nodes in this pack get - there's no state, no file access, nothing that depends on anything but the single value you hand it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| Any_input | * | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| Int | * | — |
| Float | * | — |
| Text | * | — |