ComfyUI Node

Any to String

Whatever's on that wire, as text — your debugging best friend

By r-vage·Created about a year ago·Updated 5 months ago· 23
Any to String
  • input
  • STRING

Any to String [RvTools] takes any input - model, image, int, list, you name it - and converts it to a STRING via Python's string formatting. The output is a text representation of whatever came in. That's the whole job, and for a graph-debugging workflow it's a quietly essential one.

Why you'd reach for it

ComfyUI has a dirty secret: half of what you need to see while debugging isn't visible. Seeds, sampler names, numbers flowing through pipes, the contents of a context bundle - all of it is trapped inside typed connections. This node converts any of it to text, which you can then feed into a ShowText/DisplayAny-style node, a text file saver, or a metadata writer. When "why is my seed wrong?" is the question, this is how you look at the wire.

It's also the glue for anything that needs a human-readable string downstream - logging your generation settings, stamping metadata onto an image, or just confirming a node actually produced what you think it produced.

How it works

The input socket is * (any-type), so any connection plugs in. execute does f'{input}' - Python's string conversion - and returns it as a STRING. Nothing clever, nothing lossy-by-design: images become their tensor repr (not very readable, but real), numbers become clean text, and strings pass through unchanged. The one requirement: the input is forceInput, so it has to be wired - you can't type a value in here, which keeps it strictly a converter.

Input: input - any type, must be connected.

Output: STRING - text representation of the input.

Install

Standard RvTools install:

  • ComfyUI Manager → search "RvTools" → install ComfyUI-RvTools_v2 → restart.
  • Or: cd ComfyUI/custom_nodes && git clone https://github.com/r-vage/ComfyUI-RvTools_v2, then restart.

No models or downloads; pack-wide deps (OpenCV, pilgram) install alongside it.

Gotchas

The main trap is expecting readable output from a tensor. An image or latent's repr is a wall of numbers with a tensor(...) wrapper - useful to prove something arrived, useless as a caption. For genuinely human-readable text, convert things that are already textual (seed ints, names, strings). Also note there's no list handling: feed it a list and you get the list's repr, not per-item text.

Pack note as always: RvTools v2 is deprecated (successor ComfyUI_Eclipse), and if you're loading old graphs, v1 node names won't auto-map - but a conversion utility is about the least painful remap you'll ever do.

Category🫦 RvTools II/ Conversion

Inputs (1)

NameTypeDefaultDescription
input*

Outputs (1)

NameTypeDescription
STRINGSTRING