Nodes/Elegant Nodes/Elegant Any to String Preview
ComfyUI Node

Elegant Any to String Preview

The five-second sanity check

By wipeer·Created 22 days ago·Updated 13 days ago· 2
Elegant Any to String Preview
  • source
  • string
◄wrap_textfalse►

Here's the situation: something downstream is wrong and you suspect the value feeding it. The width is 1184 when you expected 1024. The seed on the sampler isn't the seed on the node. The latent shape is off by a factor of eight. You need to see one value, now, without breaking the graph.

What it is

Elegant Any to String Preview takes any value at all, converts it to plain text, shows that text in a selectable box, and also outputs it as a string. One input, one output, no configuration. It's a debug node in the literal sense - it renders, it doesn't transform - and it's the single-value version of the pack's multi-input preview.

The pack, Elegant Nodes by wipeer, is built around subgraphs: the promise is that buttons, live results, and previews keep working on the subgraph node instead of disappearing when you collapse a region. ComfyUI's own Preview as Text shows nothing on the subgraph node; this one shows the text up there after each run, and saves the last text with the workflow, so it's visible right after loading. Given how much of the community's subgraph grumbling is exactly "I can't see anything inside this thing without opening it," that's a targeted answer, and it's the reason to pick this over the stock node rather than the conversion itself.

How it works

The conversion mirrors ComfyUI's PreviewAny (the node behind Preview as Text) - deliberately, so nothing you learned elsewhere stops applying. Text passes through as-is, numbers and booleans become their value, lists and dictionaries become indented JSON, and anything else gets printed. For tensors there's one wrinkle: the tensor printer is temporarily set to abbreviate, showing the first and last six entries per dimension. That's why a latent prints as a readable shape summary instead of several thousand numbers scrolling past.

The output is the same text, as a real STRING, which is the part people miss. It isn't a dead-end viewer.

One structural detail explains a behavior you'll notice: the node is flagged as an output node in the schema. Output nodes always execute in ComfyUI's caching model - that's how previews are guaranteed to be current - so this will render on every queue while its upstream still caches normally. It's cheap, but it isn't free, and it isn't invisible to the graph either.

The input and the output

source is the input, typed as the wildcard *, which is ComfyUI's one escape hatch from its type system: it connects to literally anything, and the node is responsible for making sense of it. You cannot wire it wrong. That's what makes "just check this value" a two-second operation instead of a hunt for a matching preview node.

The string output is worth wiring even when you only wanted to look. It feeds a Note node if you want the value recorded on the canvas, and it feeds Save Image's filename_prefix if you want the number in the filename rather than typed by hand - a small thing that pays off the first time you're comparing twenty runs.

Installing it

Through Manager: search Elegant Nodes and install. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/wipeer/comfyui-elegant-nodes.git
pip install -r comfyui-elegant-nodes/requirements.txt

Then restart ComfyUI and refresh the browser. The only dependency is simpleeval, which ComfyUI already installs, so there are no model downloads and no build step. It lands in the utilities → elegant category.

Refresh the browser properly, by the way. A chunk of this pack's behavior - the preview box, the subgraph display - lives in the pack's frontend JavaScript, so a stale page can leave you with a working node that just doesn't show you anything.

Where it bites

ComfyUI 0.4.0 or newer is required; older builds won't register the pack at all. Pre-1.0.0 workflows show a missing node because the id was renamed - this one used to be plain "Elegant Any to String" - so swap it in and re-save.

The other thing to internalize is the difference from Preview as Text: there's no Markdown mode here. If you were relying on a preview to render formatting, you'll get the raw text, which is either exactly what you wanted or a surprise. For debugging, raw is usually the point - you want the actual characters, not a rendering of them.

And if you're inspecting something enormous and the box is unreadable, remember that's the tensor abbreviation doing its job. You're seeing a shape, not data. Use it to confirm dimensions, then go look at the actual pixels.

Categoryutilities/elegant

Inputs (2)

NameTypeDefaultDescription
source*—
wrap_textBOOLEANfalseWrap long lines to the width of the preview box instead of scrolling sideways.

Outputs (1)

NameTypeDescription
stringSTRING—