ComfyUI Node

预览文本节点

A pass-through text preview for ComfyUI

By assemly·Created about a year ago·Updated about a year ago· 20
预览文本节点
    • STRING
    text

    String wires in ComfyUI are invisible. A node outputs text, it flows through the graph, and you have no idea what actually arrived until the image comes out wrong. This node fixes that: it takes a text input, prints it on the node's own face, and passes it straight through so nothing downstream changes.

    Preview Text is a debugging aid, and it's a good one. Throw it between a Multi Styles CSV and your CLIP Text Encode and you'll see exactly what the merged prompt looks like before it hits the encoder - which is when you catch the auto-translate butchering your Chinese, or a style merge that turned into "photography, photography, photography". Catching it here beats a wasted generation every time.

    How it works

    Under the hood it's embarrassingly simple: one STRING in, the same STRING out, and it's flagged as an output node so ComfyUI renders its result in the UI. The display part comes from a small JavaScript extension in the pack (web/preview_text_node.js) that adds a read-only text widget to the node. It also dumps the first 50 characters to the console, which is handy if you're SSH'd in and can't see the canvas.

    That "output node" flag is the one design choice worth knowing: it means the node counts as a terminal even though it's mid-graph, so you can drop it anywhere without disrupting your workflow. And because it passes the text through, you don't have to put it at the end - chain it in the middle and you can inspect a string at any stage of a longer pipeline.

    Inputs and outputs

    There's exactly one of each:

    • text (STRING) - whatever you want to inspect. It's forced as an input, so you can't type into it; wire it up.
    • output (STRING) - a passthrough, byte-for-byte identical to the input. Wire this to whatever the input would have fed.

    That's the entire surface area. There is no config, no toggle, no surprise.

    Install

    It ships in the same pack as Multi Styles CSV, so you get it the same way. ComfyUI Manager - search "ComfyUI Styles CSV Loader (ZH)" - or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/assemly/comfyui-styles_csv_loader_zh
    

    Restart ComfyUI and it'll be under the styles_csv_loader category, displayed as 预览文本节点. No model downloads, no heavy dependencies - requests and the optional translation libraries come along for the pack's other nodes, but this one needs none of them.

    Notes from the field

    A few things people trip on, worth saying plainly:

    • If the display stays empty, check the wire upstream - the node faithfully shows whatever arrives, including empty strings.
    • Since it's an output node, you can also use it to "peek" at any string mid-graph, not just style prompts. It works fine as a general-purpose text spy.
    • The console print is truncated to 50 characters. For the full string, use the node's own display.

    It's a thin utility - basically a friend's trick made into a node - but in a pack aimed at merging prompts you can't see, it's the piece that keeps you from flying blind. Three seconds to wire up, and it saves you from at least one "why did it generate that" per workflow.

    Categorystyles_csv_loader

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING