Nodes/ComfyUI_Text_Tools_SG/Text Tools 🧾 Viewer-SG
ComfyUI Node

Text Tools 🧾 Viewer-SG

A text viewer with a character count

By ShammiG·Created 9 months ago·Updated 6 months ago· 7
Text Tools 🧾 Viewer-SG
    • text
    text

    ComfyUI has a bad habit of producing text you can't actually read. Prompts get assembled by three different nodes, a script writes a JSON structure, and the only way to see the result is to hover over a wire and squint. Text Tools 🧾 Viewer-SG is the node you bolt onto the end of a text pipeline just to see what came out - and it's better than you'd expect a "viewer" to be.

    Feed it any STRING and it displays the text in a read-only pane with a live counter (chars, words, lines), a day/night theme toggle, copy-to-clipboard (selected text or all), search-and-highlight, a line filter, text-wrap control, a "pretty JSON" mode, and - the headliner - a markdown preview toggle. That last one is why this node earns its keep in this pack: wire in a prompt that's actually a structured document or a JSON blob, and you can flip to a rendered view instead of parsing brackets by eye. The markdown rendering uses a vendored copy of markdown-it, so it's all local - no network, no key.

    It's a companion to the pack's Text Tools 🪶 Editor-SG: the Editor is for authoring, this is for reading. In the same graph they make a sensible split - edit in one, inspect the output of a merge or script in the other.

    How it works

    The Python backend is almost nothing: one required text input (STRING), one text output that passes the string through unchanged, marked as an output node so it can push its content to the UI. Everything you see - the counter, the buttons, the preview - is a custom JavaScript widget layered over a read-only textarea. That's also the source of the node's one real weakness: because the widget is custom frontend code, it's exposed to ComfyUI's frontend churn.

    The important thing to know is what it's not: it's not a text editor. There's no input text field to type into - the field is there to receive a wire. If you want to type, use the Editor.

    Install

    Same as every node in the ShammiG/ComfyUI_Text_Tools_SG pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ShammiG/ComfyUI_Text_Tools_SG
    

    then restart ComfyUI. Or use ComfyUI Manager and search ComfyUI_Text_Tools_SG. No pip dependencies, no model downloads - it's a display widget, and it runs fine on a CPU-only install.

    The gotcha, front and center

    Here's the thing that will actually trip you up, and it's the README's top warning: if your ComfyUI is 0.3.76 or newer, switch Nodes 2.0 OFF. The new Vue-based frontend renderer breaks custom widgets like this one, and the author hasn't ported the ~1,700 lines of viewer JS. Keep Nodes 2.0 off and the node renders and behaves as designed; turn it on and you may get a broken layout or missing buttons. This is the same ecosystem fight that hit rgthree's nodes, and it's worth knowing before you go hunting for a bug in your own workflow.

    If the markdown preview button doesn't show at all, the vendored markdown-it script failed to load - hard-refresh the browser (Ctrl+Shift+R) and check the console; it's served locally from the pack, so it's a cache problem, not a network one.

    Small pack, solo maintainer, MIT licensed - don't expect a support team. But as a way to actually see what your text pipeline is producing, it's the node you'll wire in once and never take out.

    Categorytext/utils

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING