Nodes/comfyui-friendly-string/Named Text (Multiline)
ComfyUI Node

Named Text (Multiline)

Label your prompt boxes so the graph explains itself

By ZeronoFreya·Created about a month ago·Updated about a month ago· 0
Named Text (Multiline)
    • text
    key
    value

    A text box with a name tag

    Named Text (Multiline) is the smaller half of ComfyUI-Friendly-String by ZeronoFreya - a two-node pack whose entire purpose is building prompt strings out of labeled parts. On its own, this node is almost embarrassingly simple: a name field, a big text field, one string output.

    What it's actually for is tags. Once you have three or four text boxes on a canvas feeding a prompt assembler, they all look identical, and the first time you come back to the workflow a week later you can't tell which box held the lighting line. Give each one a name - quality, character, lighting - and the canvas reads itself.

    The mechanism is where it earns its keep, and it's the reason it exists rather than you just using a plain text node. Type a name, and the node's output stops being your text and becomes a small JSON envelope:

    {"__fn_key__": "lighting", "value": "golden hour rim light, f/1.8"}
    

    Format Text - the pack's other node - watches for strings starting with {, parses that envelope, and registers the value under lighting instead of under the slot letter it happens to be plugged into. That's the whole trick: it turns "text arrived in slot c" into "here is a thing called lighting," which is what lets a prompt template survive you rewiring the graph.

    The inputs that matter

    Two, and there's nothing hidden:

    • Name (key) - single-line. This becomes __fn_key__. It's also the only field you really have to think about, because it must match the {name} placeholder in your Format Text template.
    • Value (value) - the multiline box. Your actual prompt text.

    One text string comes out. Behavior branches on whether Name is filled: leave it empty and the node passes your text through untouched, which makes it a perfectly serviceable plain text box for anything you aren't parameterizing. Fill it in and you get the JSON envelope.

    There's a small frontend nicety: the pack's JavaScript renames the node's title on the canvas to 📝 <name> as you type, so the label you set is also the label you see. It also means the node's visible name in the Add Node menu is "Named Text (Multiline)" in an English UI - the pack ships a Chinese locale (📝 命名文本 ( 多行 )) that shows up if your ComfyUI is set to Chinese.

    Install

    Same as everything in this pack, and there's nothing to download:

    # ComfyUI Manager: search "comfyui-friendly-string", install, restart
    # or manually:
    cd ComfyUI/custom_nodes
    git clone https://github.com/ZeronoFreya/ComfyUI-Friendly-String
    

    Restart ComfyUI afterwards, then hard-refresh the browser (Ctrl+Shift+R) so the js/ folder takes effect - without it you won't get the live title renaming. Zero pip dependencies (the pack's pyproject.toml lists none), zero models.

    Common issues

    "The output is broken JSON." It isn't broken; that's the contract. The quickest way to see it is to wire this node to a CLIP Text Encode and run it - you'll get the literal {"__fn_key__": ...} string sent to the encoder, which is not what you want. Route it through Format Text instead. Once you internalize that the envelope is for the format node and not for the encoder, the whole design clicks.

    Names don't resolve in the template. Check the obvious ones: the {name} in Format Text must match the Name field exactly, and an empty Name means no name is registered at all - the node just forwards raw text, so {quality} has nothing to bind to. Mismatches don't throw; Format Text fills unknown placeholders with an empty string, so the failure looks like missing words, not an error.

    Two nodes, same name. They concatenate rather than conflict, joined in slot order in Format Text. Usually that's a duplicate you didn't notice.

    Is it worth installing a pack for? If you only ever type one prompt into one box, no. If you're building the multi-part prompt workflow - quality block, subject block, lighting block, negative block - this pair is one of the tidier small options, and unlike the bigger prompt-building toolkits it has nothing to configure before it works.

    CategoryFriendly Nodes/Text

    Inputs (2)

    NameTypeDefaultDescription
    keySTRING
    valueSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING