String to Integer
Bridge a text value into an integer input, safely
- INT
The integer twin of this pack's String to Float node, and by the click-through numbers, apparently the one people find most useful of the whole batch. Same job: bridge a value that's arrived as text into a real numeric connection, without your queue dying on a bad value.
What it does
One input, text_value, a plain STRING. One output, INT. Give it something that parses cleanly - "20", "1024" - and you get that number back as a real integer. Give it something that doesn't parse, and rather than throwing an error that kills the run, it logs the problem and falls back to 0.
The typical use: pulling a seed, a step count, a frame count, or any other whole-number value out of a string that arrived via text processing elsewhere in the graph - say, a value substituted in by this pack's own prompt-templating node, or something extracted from a filename - and turning it into something a numeric widget will actually accept.
It exists for the same reason its float counterpart does: ComfyUI enforces connection types strictly, and a STRING output simply will not wire into an INT input, no automatic conversion happens. Anywhere your graph produces a number as text - concatenation, a templated prompt, a value pulled from a list - this is the node that turns it back into something the rest of your workflow can actually use as a number.
Installing it
ComfyUI Manager: search DemonAlone-nodes-ComfyUI, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/DemonAlone/SimpeStringGenerator_ComfyUI
No dependencies or model downloads - pure Python glue.
Where people get burned
The same tradeoff as its float sibling: the silent-fallback behavior keeps a batch job running instead of crashing on one bad value, but it also means a typo - decimal point where there shouldn't be one, stray whitespace, a non-numeric character - quietly becomes 0 instead of raising a visible error. If a downstream setting is behaving like it's zeroed out and you can't see why, check the ComfyUI console log for the parse-failure message before you start second-guessing the rest of your graph.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| text_value | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |