ComfyUI Node

String 🦾

A string literal you can wire into your graph

By beyondprompting·Created 9 months ago·Updated 7 months ago· 0
String 🦾
    • STRING
    value

    The most honest review of String 🦾 is: it takes a string and returns the same string. That's the entire feature. And yet it's occasionally exactly what a ComfyUI graph needs, because not every text value belongs buried as a widget on some other node.

    How it works

    One input (value, a multiline text field), one output (STRING), and the execute function is a literal identity - return (value,). What you type is what comes out, newlines and all. There is no transformation, no trimming, no encoding. It's a plain text literal that happens to exist as a node.

    Why that's useful

    ComfyUI is a graph, and a graph wants named, connectable things. A String node lets you promote a text value to first-class citizen status: a filename prefix that feeds a Save Image node, a shared prompt fragment you reference in several places, a trigger-word list, or - most usefully - the text side of a switch. Pair it with a Two Way Switch or an If node and you can flip between two whole prompts, two LoRAs' worth of trigger words, or two filename schemes just by toggling one input. That's the actual reason to have it around.

    There's also a mechanical reason: some custom nodes only expose their text as a widget, and widgets can't be driven by other nodes. A String node in the middle lets you compute or switch the value before it arrives.

    The context you should know

    This node wasn't written for the Beyond Nodes pack - it's inherited wholesale from theUpsider's ComfyUI-Logic, which self-describes as "not maintained," then re-branded with the 🦾 emoji. You can tell it's a merge: it lives in the bare Logic category while the pack's own switch nodes live under Beyond nodes/Logic. None of that matters for daily use, but it explains the slightly inconsistent naming.

    And the plain truth: recent ComfyUI ships its own String utility node in core, so this one is mostly convenient because it's already installed with the pack, or because you want its explicit named output. It's not a reason to install Beyond Nodes on its own - it's a freebie that comes along.

    Installation

    Same pack, same one-time install:

    • ComfyUI Manager - search "ComfyUI-Beyond_nodes" (or "Beyond Nodes"), install.
    • Or manually:
      cd ComfyUI/custom_nodes
      git clone https://github.com/beyondprompting/ComfyUI-Beyond_nodes
      
      Restart after. No requirements.txt, no models, nothing extra - this is one of the least demanding nodes in any pack.

    Common issues

    There's almost nothing to break. The two real failure modes:

    • You wired the output nowhere. A String node that isn't connected does nothing visible - check the wire, not the node.
    • Downstream got a format error. This node transforms nothing, so if the consumer expects JSON, a filename-safe string, or a folder path, that's on you to type correctly. Multiline text is preserved exactly, including newlines - which is a feature until a filename prefix chokes on it.

    It's the platonic ideal of a utility node: zero surprises, does one trivial thing, and gets out of your way. Sometimes that's precisely the tool you need.

    CategoryLogic

    Inputs (1)

    NameTypeDefaultDescription
    valueSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING