Nodes/ComfyUI/Preview as Text
ComfyUI Node Runs on cloud

Preview as Text

The print() statement ComfyUI never had — preview anything as text

By Comfy-Org·Created 4 years ago·Updated 29 minutes ago· 129,853
Preview as Text
  • source
  • STRING

In a normal program you debug with print(). In ComfyUI, the wires are black boxes - you connect your prompt string to a KSampler and you just have to trust it arrived intact. Preview as Text (class name PreviewAny) is the trust-breaker. It takes any input, serializes it to readable text, and shows it in the UI. It's the debug node you'll reach for more than you expect.

It ships with ComfyUI core, no install needed, and it's a genuine 2026 addition - it's the upstream port of rgthree's "Display Any," the node everyone installed as a custom node for years. Now it's built in.

How it works

The input is typed *, meaning it accepts literally anything: strings, numbers, lists, dicts, tensors, conditioning, whatever. Whatever you feed it, it tries to make human-readable text:

  • Strings pass through unchanged.
  • Numbers and booleans get converted to text.
  • Dictionaries and lists get JSON-formatted with indentation, so nested structures are actually legible.
  • Tensors get shown with torch's print formatting, and here's a detail worth knowing: it limits itself to a handful of edge items per dimension. You see the shape and the corners, not all of a giant latent.
  • None just shows None.

It's an output node, so it can sit at the end of any wire without disturbing the graph flow. Add it in parallel to whatever you're curious about, run, and read the panel.

The one input and output that matter

One input, source, of any type. One output, STRING, carrying the text it produced. That output is genuinely useful on its own - you can chain it into a text display, save it to a file, or feed it to a prompt-construction node. A lot of people just use it for eyeballing, but the fact that it's a real string output means it can be a stage in a pipeline, not just a dead end.

Where people get burned

The biggest surprise is that it's not a live inspector. It evaluates when the graph runs, so it only shows you the value at the moment of execution - if you change something upstream and don't rerun, it's showing you the old value. Run, then read.

Second gotcha: for a big list or tensor, what you see is truncated by design. If the thing you're inspecting is a giant dict, JSON output can be long but it's complete; if it's a tensor, you're getting the edges and a shape summary, not a full dump. That's a feature - a full dump of a latent would freeze your browser.

Third: it's not a debugger. It shows you what's in the wire, not where a value went wrong. If your problem is "the prompt is right but the image is wrong," this node tells you the prompt is fine and the issue is downstream - which is still a win, because it halves your search space. For inspecting the things ComfyUI normally hides - the conditioning dict, the actual string a text encoder produced - it's the fastest tool in the box.

Categoryutilities

Inputs (1)

NameTypeDefaultDescription
source*

Outputs (1)

NameTypeDescription
STRINGSTRING