Convert To String
The Node That Turns Anything Into Text
- input
- output
When a number has to become words
Half of ComfyUI's frustration is the wire colors. The graph is strongly typed - a STRING output refuses to plug into an INT input, and you're left staring at a broken red connection and no idea which side is at fault. It gets worse the moment you involve an LLM or an API node. Ollama, OpenAI, Gemini, JSON Extract: all of them hand you text, and the nodes you want to feed - filename builders, text concatenators, prompt editors - are picky about what they accept. Convert To String is the translator in the middle.
It's part of the ComfyUI-TypeConverters pack, a deliberately tiny set of four nodes from zfrsgtcu that do one thing each: force an ANY input into a specific type. This one is the most-used of the four, because strings are the lingua franca of workflow automation - every other type can become one without losing anything.
How it works
Mechanically it's almost insultingly simple: it takes one ANY input and runs Python's str() on it. 123 becomes "123", 6.5 becomes "6.5", True becomes "True". The one special case is None, which comes out as an empty string instead of the literal "None" - a small touch that keeps filenames and prompts clean. That's the whole node. No settings, no fallback ladder, nothing to tune.
The inputs and outputs that matter
- input (
ANY) - this is the whole game. Because it'sANY, it accepts any wire color: numbers, booleans, text, whatever a node happens to throw at you. - output (
STRING) - a clean text value you can wire into anySTRINGport.
Practical uses: put your seed or batch size into a filename template, inject a computed CFG value into a prompt, or feed a number from a math node into a text node that insists on STRING when the wire coming in is INT. If you're building dynamic workflows where text has to be assembled from live values, this is the glue.
Installing it
ComfyUI Manager is the easy route - search for the pack by its title "ComfyUI-TypeConverters" and hit install. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/zfrsgtcu/ComfyUI-TypeConverters
Restart ComfyUI and the node shows up under the zfr-nodes category. There are no models to download and no requirements.txt - the whole pack is a single Python file with zero dependencies, which is a genuinely nice change from the packs that drag in a hundred packages.
Gotchas worth knowing
str(True) gives "True" with a capital T. If you're building lowercase text - say, a token for a filename - you'll want a case-fixing node downstream. And floating point values stringify in their full glory (6.5 stays "6.5"), which is usually what you want. The only failure mode you're likely to hit is the opposite problem: feeding text into this node when you meant to convert it from text to a number. If a value shows up as a string in the wrong place, check whether you actually needed one of its siblings - Convert To Integer, Float, or Boolean.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | STRING | — |