Tag Injector Duo
Two placeholders, straight from the README
- tagged_text
- placeholders
The README covers this one directly and plainly: "TagInjectorDuo – same idea [as Single], but for two tags (e.g. elements and stuff)." That's the whole node. It's part of a small family - Single (one placeholder), Duo (two), the unsuffixed base Tag Injector (three), and Large (ten) - all doing the identical substitution trick at different scales, so pick the one that matches how many independently-swappable pieces your template actually needs rather than defaulting to the biggest one out of habit.
How it works. Write a template string containing __placeholder__-style markers - default is just __elements__ - and supply values through tag_1/tag_2, each named by tag_name_1/tag_name_2 (defaulting to elements and stuff). The node finds each named placeholder in the template and swaps in the matching value. A template like "a __elements__ with __stuff__ scattered around" fed tag_1="wooden table" and tag_2="scattered leaves" comes back as "a wooden table with scattered leaves scattered around" - straightforward text substitution, no wildcard randomness involved unless you feed it a randomizer's output as the tag value.
The difference between this and something like the pack's Simple Wildcard Picker is worth being clear on: wildcard picking chooses randomly for you from a set of options, seeded. Tag injection doesn't choose anything - you decide the values, the node just does the mechanical swap. They compose well together: feed a wildcard pick as the value for tag_1, and you get random selection and a clean, editable template in one graph.
Inputs and outputs. template (required, multiline, default "__elements__"). tag_1/tag_2 (optional, multiline strings) - your two substitution values. tag_name_1/tag_name_2 (optional strings, default elements/stuff) - which placeholder each targets. Outputs: tagged_text (the substituted result) and placeholders (undocumented beyond its name - treat it as a debug/status string rather than something to route further).
Installing it. No dependencies, plain string handling. Search "comfyui_gr85" in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/veighnsche/comfyui_gr85
Restart ComfyUI.
Where it goes wrong. Same trap as the rest of the family: the __placeholder__ text in your template has to match tag_name_N exactly. The defaults line up out of the box, but rename tag_name_1 and forget to update the corresponding __elements__ in your template, and that tag silently never gets substituted - you'll ship a literal __elements__ string into your prompt and not notice until the output looks wrong for no obvious reason. Get in the habit of eyeballing tagged_text before it goes anywhere near a CLIPTextEncode. And if you find yourself reaching for a third or fourth placeholder, that's the sign to switch up to the base Tag Injector or Tag Injector Large rather than gluing two Duo nodes together.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| template | STRING | __elements__ | — |
| tag_1opt | STRING | — | |
| tag_2opt | STRING | — | |
| tag_name_1opt | STRING | elements | — |
| tag_name_2opt | STRING | stuff | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| tagged_text | STRING | — |
| placeholders | STRING | — |