Nodes/ComfyUI_TextRandomizer/🏷️ Text Random Replacer (MultiLine)
ComfyUI Node

🏷️ Text Random Replacer (MultiLine)

The same tag swap, but for full paragraph prompts

By fls-eugene·Created 2 months ago·Updated 2 months ago· 0
🏷️ Text Random Replacer (MultiLine)
    • completed_prompt
    text
    target_tag#TAG
    replacement_options
    seed1

    "🏷️ Text Random Replacer (MultiLine)" is, bluntly, the same node as Text Random Replacer with a bigger text box. Where its sibling only accepts a single-line template, this one's text field is a proper textarea, so you can paste a full paragraph prompt with a #TAG in the middle and randomize just the tagged part. Same weighted option list, same seed, same completed_prompt output. If you already understood the single-line version, you understand this one - the only real question is which one your prompt fits in.

    Why it exists

    Long prompts are the norm once you leave tag-based models behind. Sentence-style prompts - "a lone figure walks through a rain-soaked market at night, cinematic lighting" - don't fit a single-line widget comfortably, and cramming them in invites the exact silent pass-through failure its sibling warns about. The MultiLine version is the one you actually keep on your canvas for paragraph templates.

    Underneath, both nodes share the same base class, and there's one bonus in that shared code worth knowing: the replacer engine is batch-aware. If you feed it a list of templates (from a batch node) and a list of replacement options, it zips the two together and cycles, so a whole batch can get coherent variation - template one gets option one, template two gets option two - instead of each template rolling independently. That's genuinely handy for the character-reference-library workflow the KB's prompt-engineering notes highlight: batch 32, same person, different settings, all from one template.

    The inputs that matter

    • text - the multi-line template with your #TAG placeholder.
    • target_tag - default #TAG; swap it to #LOCATION, #CHARACTER, whatever fits.
    • replacement_options - candidates, one per line, ::weight supported (cyberpunk hacker :: 2).
    • seed - pins the pick; same seed plus same inputs reproduces the exact prompt.

    Output: completed_prompt (STRING) → CLIP Text Encode.

    Installing it

    Identical to the rest of the pack - zero dependencies, no requirements.txt, no model files, pure Python. The README is a "TODO." stub, which is honest documentation for a pack this self-contained.

    ComfyUI Manager → Custom Nodes Manager → search "TextRandomizer" → Install → Restart
    

    or cd ComfyUI/custom_nodes && git clone https://github.com/fls-eugene/ComfyUI_TextRandomizer and restart. No pip step exists.

    Gotchas

    The tag-missing silent pass-through applies here too - if your target_tag isn't literally in the text, nothing gets randomized and nothing tells you. And "MultiLine" is about the template; the replacement options are always one-option-per-line regardless. If your template is short, save yourself a search and use the single-line version; if it's a paragraph, this is the one.

    CategoryTextRandomizer/Text

    Inputs (4)

    NameTypeDefaultDescription
    textSTRING
    target_tagSTRING#TAG
    replacement_optionsSTRING
    seedINT10–18446744073709550000

    Outputs (1)

    NameTypeDescription
    completed_promptSTRING