[SSN] Convert String To Others
String to numbers, with a forgiving '0 on garbage' fallback
- float
- int
[SSN] Convert String To Others takes text and tries to turn it into numbers - a float output and an int output. Feed it "3.7" and you get 3.7 and 3. Feed it "hello" and you get 0.0 and 0. It's the pack's safety-net converter, and that safety net is the most important thing to understand about it.
The use case that makes this node earn its place: you're pulling text out of a JSON node, an LLM node, or an API response, and that text is supposed to be a number - a width, a seed, a steps value that arrived as a string. ComfyUI's typed sockets won't let a STRING plug into an INT, so you need a converter, and this one is designed to be forgiving when the upstream data isn't what you expected. Instead of hard-failing on unparseable input, it falls back to zero.
That forgiveness cuts both ways. Zero-on-garbage means a typo in your upstream JSON silently becomes a 0 width or a 0 seed, and you may not notice until the output looks wrong. If you'd rather get a loud error than a quiet zero, this node isn't it. For a debugging workflow that's a real trade to make consciously - the node's own docs say "defaulting to 0 if the conversion fails," which is exactly what the source does: a try/except around float() and int() that catches ValueError and TypeError and substitutes 0.0 / 0.
Worth noting on the int side: it converts via the float, so "3.7" becomes int 3 (truncated), not rounded to 4. If you need rounding you'll want to take the float output and run it through a round-capable node.
This is plumbing-layer glue through and through - the kind of thing that lives between "data as text" and "data as numbers" in a graph that mixes JSON, prompts and math. It's not flashy, and it's not something you'll think about once it's wired, which is the compliment.
Install
Part of smn_support_nodes by SummonTheCat. ComfyUI Manager → search smn_support_nodes → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/SummonTheCat/smn_support_nodes
Restart required. Dependencies (opencv-python, imageio-ffmpeg) auto-install; no models to download.
Troubleshooting
The only real failure mode is the quiet-zero fallback biting you. If a downstream node suddenly gets a 0 where you expected a number, trace the string back upstream - it's not this node misbehaving, it's the string not parsing. Locale quirks also matter: a comma decimal like "3,7" will parse as 0 here, since Python expects a period. And remember truncation: "2.99" gives int 2, so if the integer output looks "wrong," check whether you actually wanted the float output instead.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| string | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| float | FLOAT | — |
| int | INT | — |