Nodes/Sage Utils/Anything to String
ComfyUI Node

Anything to String

The universal converter for when a node wants text and you have a number, list, or latent

By arcum42·Created 2 years ago·Updated 28 days ago· 33
Anything to String
  • any
  • str

ComfyUI is full of type friction. A metadata node wants a string, but the value you have is an integer from a width output, a float seed, or a list of filenames. Anything to String is the dumb little converter that resolves that: it takes literally any input - the schema type is *, meaning ComfyUI will accept any type of wire - and returns it as a STRING.

What it does under the hood is about as simple as a node gets: str(whatever_you_gave_it). One detail worth knowing: if you feed it a list, it doesn't just stringify the Python list with brackets and commas - it joins the items with newlines, one per line. That makes it genuinely useful for batch outputs (a list of image paths, a list of metadata strings) where you want a readable block of text rather than Python repr noise. Everything else just gets its str() representation.

Where does this actually get used? Mostly as glue in the Sage Utils metadata pipeline. The pack's metadata constructors want prompt strings, but widths, heights, seeds, and steps arrive as ints. Rather than hand-wiring a dozen primitive nodes, one Anything to String converts each number on the way in. It's also the node you reach for when you're debugging: any mystery output can be dropped into a text display to see what it actually contains. That's a real workflow-saving habit - "what IS this thing?" is answered in one node.

There's nothing to configure, which is the point. One input (any), one output (str). No defaults to trip over, no modes. If you're the type who resents any graph clutter, note that ComfyUI's core now ships a similar "to string" utility in some versions, but if you're already running Sage Utils this one is right there in the pack, and it's battle-tested glue for the pack's own nodes.

Install

Same pack ritual: ComfyUI Manager → search Sage Utils → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils.git
cd ComfyUI_SageUtils && pip install -r requirements.txt

Restart ComfyUI. Dependency-free aside from the pack's single dynamicprompts requirement. No models, no keys, nothing to configure - wire it in and it works.

CategorySage Utils/text/conversion

Inputs (1)

NameTypeDefaultDescription
any*Any input value to convert to a string.

Outputs (1)

NameTypeDescription
strSTRINGOutput value for str.