Convert to String
Convert to String (ConvertAny2String) — ComfyUI-LogicUtils
- input1
- STRING
Half the string fields in ComfyUI want text, and half the values floating around your graph are numbers. A seed, a step count, a random draw, the output of some math node, none of that will drop straight into a filename prefix or a text box. This node is the bridge: hand it anything, get its text representation back as a STRING.
It's the mirror image of the boolean converter in the same pack, and it's just as unglamorous. Its whole reason to exist is composability. Once a number is a string you can stick it into a save-file prefix, splice it into a prompt, feed it to a display node, or concatenate it with other text. Without a converter like this, a value that's "obviously" a number as far as you're concerned is a type mismatch as far as ComfyUI is concerned, and it won't let you make the wire.
ConvertAny2String comes from ComfyUI-LogicUtils, aria1th's logic-and-math utility pack. aria1th is the handle behind AngelBottomless, who trained Illustrious XL, and this pack is his personal toolbox rather than a product, so the nodes are lean and the documentation is close to nonexistent. You learn them by plugging them in.
Inputs and outputs
One input, input1, typed * (wildcard, takes anything) with a default of 0. One output, a STRING. It calls the standard string conversion on whatever you give it and returns the result. No knobs, no options.
Where the output goes is the point. A filename prefix that includes the seed, a label that shows the current step count, a prompt that gets a computed value spliced in: all of those start with turning a non-string value into a string right here.
Installing it
- ComfyUI Manager: Custom Nodes Manager, search "ComfyUI-LogicUtils," install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart.
No models to fetch, no heavy dependencies. The optional dependency auto-installer only runs if you set COMFYUI_LOGICUTILS_AUTO_INSTALL=1 (kill it with COMFYUI_LOGICUTILS_SKIP_INSTALL=1), and a string converter needs none of that.
Small gotchas
The formatting is whatever the default conversion produces, so a float comes out looking like a float, 3.0 rather than 3. If you're building a filename and want a clean whole number, run the value through Round first to get an integer, then convert. Otherwise you'll end up with decimals in places you didn't want them.
That aside, it does one job and does it quietly. Reach for it any time ComfyUI refuses a connection because "that's not a string" and you know perfectly well the value is fine, it just needs to wear the right type on the way in.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input1 | * | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |