Nodes/ComfyUI-Text/PlaceholderText
ComfyUI Node

PlaceholderText

The $1/$2 template node hiding in ComfyUI-Text

By MarkoCa1·Created 2 years ago·Updated 2 years ago· 9
PlaceholderText
    • text
    text1
    text2
    placeholder$1,$2

    PlaceholderText is a three-field template machine. You hand it two strings and it drops them into a template at the spots marked $1 and $2. No API, no model, no dependencies - a handful of pure-Python lines from MarkoCa1's tiny ComfyUI-Text pack, the same author who later shipped ComfyUI_Segment_Mask, the pack people actually talk about. This node? Nobody's found it yet. It has effectively zero community footprint, which is half the appeal: it's already sitting there if you installed the pack for any other reason.

    Why you'd reach for it: ComfyUI has no native way to compose a prompt from parts, so "fixed template, changing values" usually means dragging in a wildcard system or a heavyweight text pack. PlaceholderText is the zero-dependency middle ground. Want "a photo of $1, $2, shot on a point-and-shoot film camera"? (That last phrase is the highest-leverage trick in photorealism prompting, but that's a separate rabbit hole.) Type the template in, feed the two variables, and you can batch variations without editing a wall of text every run.

    How it works: it's a dumb, honest string replace. The source is five lines - it builds {$1: text1, $2: text2} and replaces each key in the template in order. Set the template to the default $1,$2 and you get text1,text2, which is exactly CombinationText's default output; the two nodes overlap on purpose. The difference shows up when your template has real text around the slots, like the sentence above.

    The inputs that matter:

    • text1 / text2 - multiline strings. Type in them or wire strings in from upstream nodes (right-click → Convert to input).
    • placeholder - the template, default $1,$2. This is the field you actually live in. $1 and $2 are the only slots it recognizes, no $3.
    • Output: text (STRING) - the finished template, wire it into a CLIP Text Encode node or anywhere a string is accepted.

    One gotcha: replacement is sequential and naive. If your text1 literally contains $2, the second replace pass will rewrite it. Edge case, but it bites if your content legitimately has dollar-sign-two in it. And with only two slots, bigger templates mean nesting (run PlaceholderText's output into another PlaceholderText) or grabbing a beefier pack.

    Install, and it's genuinely light:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MarkoCa1/ComfyUI-Text
    # restart ComfyUI
    

    Or use ComfyUI Manager → search ComfyUI-Text → Install, then restart. requirements.txt is empty - zero pip packages, no model downloads. The author's README says he built the pack so he wouldn't have to install anything extra, and he meant it. Worth knowing for any custom node you pull from an obscure repo: installing a node means running its code on your machine, so read the source first. This one is four classes and about sixty lines; you can eyeball the whole thing in a minute.

    Troubleshooting is nearly a non-topic. If a shared workflow complains about a missing PlaceholderText, Manager installs it cleanly and a restart fixes the search path. The pack's README is one screenshot and a sentence - no usage docs at all - so treat this page as the manual. Reach for PlaceholderText when the structure is fixed and the values vary; grab CombinationText when all you need is a join.

    CategoryMK/text

    Inputs (3)

    NameTypeDefaultDescription
    text1STRING
    text2STRING
    placeholderSTRING$1,$2

    Outputs (1)

    NameTypeDescription
    textSTRING