Nodes/honda-nodes/πŸ”€ Text Preview
ComfyUI Node

πŸ”€ Text Preview

Read the string on the canvas instead of in a terminal

By AvarayΒ·Created 14 days agoΒ·Updated 12 days agoΒ· 0
πŸ”€ Text Preview
    • Text Pass-through
    β—„text_inputβ€”β–Ί

    ComfyUI is great at showing you pixels and bad at showing you strings. Preview Image has existed for years; there was never an equivalent for the text a workflow is actually passing around, so people either added a console print or wired the string into a save node and opened a file. Text Preview puts a scrollable read-only box on the node body and passes the value through, which is the right answer for the ninety percent of debugging that's "what does this string actually say".

    How it works

    The Python side is three lines: take the string, return it, and attach a UI payload (ui.PreviewText). The rendering is done by the pack's own frontend extension (web/js/text_preview.js), which injects a monospace, read-only <textarea> into the node body and fills it when execution results come back. It's the same extension that gives Honda's JSON Get Value node a preview pane, for what it's worth.

    The textarea is deliberately read-only and styled to fill the node - flex: 1, resize: none - and the node has a sensible default size (340Γ—200) from the pack's node_sizes.js, so long strings get a scrollbar rather than stretching the canvas. You can resize the node anyway; the box follows.

    Because the payload comes back with execution results, the content appears after you hit Run, not as you type. There's no live binding to the upstream widget.

    The inputs and outputs that matter

    One input, Text Input - a forced input, so it must be wired (a Text node, a Text Concatenate, Load Image's Metadata, Read File, whatever produces a STRING). One output, Text Pass-through, the exact same string.

    That pass-through is what makes it usable mid-graph instead of only at the end. The pattern:

    Text Concatenate β†’ Text Preview β†’ Save Image.filename

    The preview sits in the chain, you see the filename that's about to be generated before the images appear, and nothing about the pipeline changes. Do the same on a prompt right before it hits the encoder: when an image comes out wrong, the first question is always "what string did the encoder get", and this answers it without leaving the canvas or opening a log.

    It's registered as an output node, so it always executes and the engine works backward from it - the same behaviour as Preview Image, with the same consequence: it drags its upstream chain into every run. That's ideal while you're iterating and mildly wasteful once you're not. Delete it (or mute it) when the workflow is final rather than leaving five of them in a shipping graph.

    How to install it

    Part of Avaray/honda-nodes - ComfyUI Manager β†’ Node Pack β†’ search Honda Nodes β†’ Install β†’ restart. Manual:

    cd ComfyUI/custom_nodes
    git clone --depth 1 https://github.com/Avaray/honda-nodes.git
    cd honda-nodes
    python install.py
    

    No dependencies for this node specifically; install.py is there for the pack's jq and ime binaries. But this node does depend on the pack's frontend JS, so it needs the pack served as /extensions/honda-nodes/ - which happens automatically when it's installed in custom_nodes/. Requires ComfyUI 0.38.0+ (V3 schema API).

    Common issues

    The node runs, the box is empty. The frontend extension didn't load. Hard-reload the browser (Ctrl/Cmd+Shift+R) and check the console for a 404 on the pack's JS - stale cached frontend files are the number one cause of "node installed, node looks broken" with any pack that ships custom JS.

    Nothing shows until I run. By design; the content arrives with execution results.

    The box shows one long line. That's your string - it has no line breaks. Multiline prompts look like prompts; filenames and JSON blobs don't. For a JSON blob, JSON Preview is the better tool; it parses and renders a tree instead of dumping 4000 characters into a textarea.

    Very long values make the node unwieldy. Resize it, or put the preview somewhere you can ignore. There's no truncation on this node (unlike JSON Preview, which has a length limit toggle).

    I can't edit the text to test something. It's read-only on purpose. Put a Text node upstream, edit there, re-run.

    Category⚑️ Honda Nodes/πŸ”€ Text

    Inputs (1)

    NameTypeDefaultDescription
    text_inputSTRINGThe text you want to preview.

    Outputs (1)

    NameTypeDescription
    Text Pass-throughSTRINGβ€”