TypeConversion(IOHelpers)
STRING, INT or FLOAT? This node converts — but feed it carefully
- STRING
- INT
- FLOAT
ComfyUI's wires are strongly typed. An INT output won't happily drop into a FLOAT widget, and a number you want to treat as text needs an explicit step. TypeConversion(IOHelpers) is that step: a small three-way converter that turns STRING into INT, INT into FLOAT, or any pairing in between.
You'll reach for it when the math node gives you a FLOAT but the seed or step widget you're feeding wants an INT, or when a string from a text node is actually a number you need to do arithmetic on. It's not glamorous - it's the duct tape that keeps strongly-typed graphs from fighting you.
How it works
You tell it two things: which type you're feeding in and which type you want out. It picks up only the value widget that matches your input_type, runs Python's conversion (str(), int(), or float()) on it, and returns all three output wires - the converted one carries your value, the other two are inert placeholders. If output_type is INT, only the INT output matters; the STRING and FLOAT outputs are just there so the signature is uniform.
Inputs and outputs
- input_type - STRING, INT or FLOAT. Which value widget gets read.
- output_type - STRING, INT or FLOAT. What you want out.
- string_value / int_value / float_value - the three optional value inputs. Fill the one matching
input_type.
Outputs: STRING, INT and FLOAT - wire the one that matches output_type, ignore the rest.
Installing it
Part of the same single-file, dependency-free pack from GitHub user Ryuukeisyou - no requirements.txt, no models, nothing to download beyond the repo. ComfyUI Manager → search "comfyui_io_helpers" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Ryuukeisyou/comfyui_io_helpers
Restart ComfyUI; it's under "io_helpers".
Common issues - this node rewards care
- Only the value matching
input_typeis read. The other two widgets are ignored entirely. Setinput_typeto INT and it readsint_value, period. - STRING → INT is pickier than it looks. The conversion is Python's
int(), which rejects anything that isn't an integer literal."3"converts fine;"3.7"raises aValueErrorand kills the queue. Convert to FLOAT first if your string might contain a decimal. - Empty widgets become
None- andNonebites.int(None)andfloat(None)crash with aTypeError. Andstr(None)doesn't error - it produces the literal four-character string"None", which will silently poison whatever consumes it. Type a real value into the matching widget; "empty" is not a safe default here. - FLOAT → INT truncates, it doesn't round.
3.7becomes3. If you need rounding, round before converting.
It's the fiddliest node in the pack, but when a graph is fighting you over types, it's exactly the tool to have around.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| input_type | COMBO | 3 options: STRING, INT, FLOAT | |
| output_type | COMBO | 3 options: STRING, INT, FLOAT | |
| string_valueopt | STRING | — | |
| int_valueopt | INT | — | |
| float_valueopt | FLOAT | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |
| INT | INT | — |
| FLOAT | FLOAT | — |