Nodes/AK Pack/Preview Raw Text
ComfyUI Node

Preview Raw Text

See what that text node is actually outputting

By akawana·Created 9 months ago·Updated 7 days ago· 2
Preview Raw Text
  • list_values
  • STRING
text

Every ComfyUI user eventually hits the same wall: a node somewhere is producing text, and you can't tell what it actually contains. Maybe it's a prompt-builder spitting out a string, maybe it's an API node returning JSON, maybe it's a list you're not sure is the right length. PreviewRawText is the debug window for that. You wire text in, it shows you the literal contents in the UI, and it passes the text straight through on its STRING output so it doesn't interrupt your chain.

The README's summary is accurate and modest: it displays text, formats JSON, and supports showing a list of texts. That's the whole job, and for a debugging node, that's the right scope.

How it works

Two optional inputs, one output:

  • text - any string you want to inspect.
  • list_values - a list of strings; the node flattens each entry onto its own block for readability.
  • STRING output - the final text, passed along so the node can sit inline in a text pipeline rather than dead-ending it.

The useful behavior is the formatting. If the incoming text looks like JSON - starts with { or [ - the node pretty-prints it with proper indentation before showing it. That alone saves you from eyeballing a wall of escaped JSON that some API or metadata node just produced. For lists, each item becomes its own block separated by blank lines (nested lists get flattened one level), and None entries render as the literal NONE instead of vanishing silently - which is exactly the kind of thing you want to see when debugging. If both inputs are connected, both are shown, text first.

Since it's an output node, the preview panel opens with the contents every time it runs. That's the point: it's a live look at what's flowing through your graph at that exact spot.

When you'd actually use it

  • Right after an LLM or API node that returns JSON, to confirm the shape before you parse it further.
  • Downstream of a prompt wildcard or text-list node, to check which values actually made it out.
  • In a batch/prompt pipeline where you suspect an empty string or a missing value is silently corrupting results - this makes the NONE visible.

It's a simpler cousin of the ubiquitous "Show Text" nodes - same debugging role, plus the JSON pretty-printing and list handling that make it slightly nicer for structured data. If you've never needed one of these, you will eventually; this one is fine to have installed for the day you do.

Install

Standard AK Pack. ComfyUI Manager → search "AK Pack" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/akawana/ComfyUI-AK-Pack

No extra dependencies, no models.

Honest caveats

  • It's a viewer, not a formatter. The pretty-printed JSON is for display; the STRING output passes through the original text, so your downstream parser still sees exactly what the source produced. That's usually what you want - a debug node shouldn't change your data.
  • It only formats strings that already are JSON. Broken or partial JSON gets shown as-is, which is honestly useful too - you can see where it broke.
  • If you're inspecting structured objects rather than strings, this isn't the tool; you want a node that shows types or a JSON viewer. PreviewRawText is strictly for text-shaped data.
CategoryAK/utils

Inputs (2)

NameTypeDefaultDescription
textoptSTRING
list_valuesoptLIST

Outputs (1)

NameTypeDescription
STRINGSTRING