ComfyUI Node

TextInputBasic

A multiline text box with prefix and suffix sockets

By idrirap·Created 3 years ago·Updated about a year ago· 268
TextInputBasic
    • text
    text
    prefix
    suffix

    TextInputBasic is the pack's contribution to the eternal ComfyUI question of "how do I just type a prompt into the graph?" It's a multiline text box - the kind you type a prompt into - with two extra string sockets bolted on: prefix on the left and suffix on the right. The output is prefix + text + suffix, joined and sent out as one STRING. That's the whole node, and for a pack whose real business is trigger words, it's the convenient place to hold the hand-written part of your prompt.

    Why bother, when ComfyUI ships its own CLIP Text Encode with a text widget? Because that widget's text is buried inside the node and can't be fed from the outside. TextInputBasic turns the free-text part of your prompt into a proper node with wire sockets, which matters the moment you want to assemble prompts programmatically. The typical pattern inside this pack: TagsSelector produces a filtered trigger-string on one wire, a Randomizer or FusionText produces another fragment, and TextInputBasic is where your stable, hand-authored prompt text lives, ready to be prefixed or suffixed by whatever the graph computed.

    How it works

    One required input, text (a multiline STRING - hit Enter and you get real line breaks, same as the prompt box in stock nodes). Two optional inputs, prefix and suffix, both plain strings with forceInput, meaning they're wired sockets rather than typed-in widgets. One output, text.

    return (prefix + text + suffix, )
    

    Literal concatenation, no comma insertion, no trimming. If you want a comma between the prefix and your text, type it into the prefix. That's the entire contract, and it's why the node is reliable: nothing is silently added to your prompt.

    A couple of practical notes. The output is a STRING, so it can't be wired straight into a CLIP Text Encode's prompt input unless that input is set to accept a connection - in most stock ComfyUI setups, you'll pipe this through a text-concat or prompt builder that accepts string inputs, or into the pack's own FusionText chain. And since it's plain concatenation, empty prefix/suffix inputs contribute nothing, so you can leave them disconnected entirely and it degrades to a plain text box.

    Installing

    Part of ComfyUI-Lora-Auto-Trigger-Words. Install via ComfyUI Manager (search "ComfyUI-Lora-Auto-Trigger-Words") and restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/idrirap/ComfyUI-Lora-Auto-Trigger-Words
    

    No dependencies, no model downloads, nothing to configure. If you need more than one text box or want string templating, there are bigger text-utility packs - but for a clean, socket-friendly prompt box inside this pack's workflow, this is it.

    Categoryautotrigger

    Inputs (3)

    NameTypeDefaultDescription
    textSTRING
    prefixoptSTRING
    suffixoptSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING