Nodes/ComfyUI-JNodes/Anything To String
ComfyUI Node

Anything To String

Stringify any wire so you can inspect it or feed it to a text input

By JaredTherriault·Created 3 years ago·Updated about a month ago· 91
Anything To String
  • anything
  • STRING

JNodes_AnyToString takes literally anything and turns it into text. Number, boolean, list, whatever's on the wire - it accepts a wildcard input and hands back a STRING. The readme puts it plainly: it turns any input into text "as python would stringify it for JSON." Two everyday uses: debugging a graph by peeking at what a value actually is, and adapting a non-string value into a node that only accepts a string (dropping a number into a filename or a metadata field, say).

It's a small connector node from Jared Therriault's JNodes suite - the kind of glue you don't think about until a type mismatch stops you cold, at which point it's exactly what you needed.

How it works

The input accepts any type (it's a wildcard * pin), and the node converts whatever arrives into its string representation - the same form Python would produce serializing it to JSON. A 5 becomes "5", a True becomes text, a list becomes its bracketed form. That output is a normal STRING, so it plugs into any text input downstream, or into a show-text node so you can read the value on screen.

The inputs and outputs

  • anything (*, wildcard) - connect any output here, regardless of type.
  • STRING output - the stringified value.

That's the whole node: one input that takes everything, one string out.

How to install it

Via ComfyUI Manager: Install Custom Nodes, search "JNodes", install, restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/JaredTherriault/ComfyUI-JNodes
pip install -r ComfyUI-JNodes/requirements.txt

then restart ComfyUI. No model downloads.

Common issues & troubleshooting

It's built for simple values, not big objects. Feed it a number, boolean, or short list and you get exactly what you'd hope. Feed it an IMAGE tensor, a MODEL, or a LATENT and you'll get an unhelpful object description rather than the contents - because there's no meaningful text form of a multi-megabyte tensor. Use it on scalars and small data structures; for images you want a preview node, not a stringifier.

Great for filenames and metadata. The classic move is taking a numeric value - a seed, a step count, a token count from JNodes_TokenCounter - and stringifying it so it can go into a filename format or a metadata field that only takes text. That adaptation is most of what this node is for.

Pair it with a show-text node to debug. If you're not sure what's flowing through a wire, tap it into JNodes_AnyToString and then into any text-display node. It's a quick, zero-commitment way to see a value mid-graph without restructuring anything.

The output is a representation, not a re-parseable value. Converting to string is one-way in practice - you can read it, but there's no guarantee some other node can turn the text cleanly back into the original type. If a downstream node needs an actual number, keep the numeric wire around; don't route it through here and expect the type to survive.

Categorysd

Inputs (1)

NameTypeDefaultDescription
anything*

Outputs (1)

NameTypeDescription
STRINGSTRING