Number → String
And why you'll get '5.0' instead of '5'
- STRING
Number → String takes a NUMBER and turns it into its text form. Sounds trivial. It is trivial. But there's one gotcha that trips everyone the first time: because ComfyUI's NUMBER type is a float under the hood, a value of 5 becomes the string "5.0", not "5". If you're building a filename or a label and that trailing .0 bothers you, you now know why it's there.
Why you'd reach for it
You convert numbers to text when you want to show a value or name something with it. The common cases: building a save filename that embeds the seed, the steps, or a strength; producing a label or caption for a text node; passing a numeric result into a prompt-builder so the final prompt describes what actually happened. String is the universal carrier in ComfyUI - text nodes, file paths, and prompts all speak it - so anything numeric that needs to travel through that world has to become a string first.
The "5.0" thing is the practical caveat. It's correct Python str() behavior, and the author's description is just "Converts a NUMBER to its string representation." If you need a clean "5", convert the number to an INT first (the pack's Number → Int truncates), or route it through String → Int if you're already in text land. For most filename/label use, "5.0" is harmless - but it's worth knowing it's coming.
How it works
Python's str(value) on the float-backed NUMBER, no rounding, no formatting options. It lives in the SimpleLogics/Convert category with the pack's other converters.
The inputs that matter
One required input:
value- theNUMBERto stringify (defaults to0)
One STRING output, ready to wire into any text node, filename node, or prompt builder.
Installing it
Ships in danipisca07/ComfyUI-SimpleLogics, the dependency-free pure-Python pack - no requirements.txt, no downloads. Install from ComfyUI Manager (search "SimpleLogics") or:
cd ComfyUI/custom_nodes
git clone https://github.com/danipisca07/ComfyUI-SimpleLogics
Restart ComfyUI and you're set.
Common issues
The .0 formatting is the only surprise, and it's not a bug - it's the float type leaking into the string. If your string comes out with a decimal you don't want, go through an INT conversion first. There's no crash mode on this node; the only way to break it is to feed something that isn't a number, which won't happen because the socket is typed. Usual pack note: installing SimpleLogics also registers an undocumented GeoCalib camera node, which is unrelated - ignore it. That's the whole troubleshooting list for a str() call.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | NUMBER | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |