Nodes/RuYi-Nodes/RuYi text-preview
ComfyUI Node

RuYi text-preview

RuYi text-preview

By RuYi-Xiao·Created about a month ago·Updated 13 days ago· 3
RuYi text-preview
    • STRING
    text

    The least glamorous node in RuYi-Nodes is the one you'll reach for while debugging, which is saying something for a pack whose other two nodes are LoRA loaders. RuYi text-preview is a plain STRING pass-through that also displays its input after execution. Wire a string in, run, and the full text shows up in the node's preview; the same string flows out the other side completely unchanged.

    Why a display node earns its place

    Because merged-prompt workflows are exactly where you can't see what you're sending. The whole point of the RuYi loader's trigger_words output is to auto-collect trained words and combine them with your main prompt through a STRING concatenate step - and the instant you do that, the actual text the sampler receives stops being something you can read off any single widget. The README's own example pipeline is precisely this:

    Main prompt STRING ────┐
                           ├─ STRING concatenate ──> final prompt STRING ──> sampler
    RuYi trigger_words ────┘                              │
                                                          └─> RuYi text-preview
    

    You splice the preview in between the merge and the sampler, and the mystery of "why is my character LoRA doing nothing" usually resolves in one run: the trigger words aren't there, or they're duplicated, or the concatenation order is wrong. It's the print statement for prompt plumbing.

    How it works

    Mechanically it's about as simple as a ComfyUI node gets. A text input of type STRING, one STRING output, and a preview() method that returns the text verbatim while emitting a UI payload so ComfyUI renders it in the node body and captures it in run history. Two details make it smarter than the naive version. First, it's flagged as an output node, so what it shows is recorded with the run - you can scroll back and see the exact string from three generations ago, which is what you actually want when the output looks wrong. Second, the text input is forceInput: the widget has to be wired from something, which quietly kills the classic failure mode where you type text into a node, wonder why the sampler ignores your edit, and eventually realize the node was reading from a wire you left connected. Here, the wire is mandatory.

    It overlaps with ComfyUI's primitive string nodes and the "show text" utilities in bigger packs, but there's a reason the README pairs it specifically with the LoRA loaders: it's the same pack, so it's the one inspection node you already have, and it passes the string through - you don't have to break your graph to look at it.

    Install

    Same pack, same one-time install. ComfyUI Manager: search RuYi-Nodes. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/RuYi-Xiao/RuYi-Nodes.git
    

    Restart ComfyUI. No extra Python dependencies - this node is barely more than a str() call.

    Gotchas

    The display updates when the node executes, not as you type, so a "stale" preview usually means the graph hasn't re-run. An empty preview means an empty string got in, not a bug. And because the input is coerced with str(), numbers in become strings out - harmless for prompts, but if you're expecting the output to stay numeric for some downstream node, this isn't the pass-through for that. It's a tiny tool, but for anyone stitching together prompts and trigger words it's the difference between debugging blind and seeing the answer on screen.

    CategoryRuYi-Nodes/text

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING