prompt - add
Add a tag to the head or tail of a prompt, the tag-aware way
- STRING
"Add a tag to my prompt" is one of those things ComfyUI makes awkward: you end up hand-editing a string mid-workflow, which is fragile and unshareable. Prompt - add fixes it with an action dropdown: add2head, add2tail, del|add2head, del|add2tail, or none. It's tag-aware - it understands comma-separated tags and does the right thing, rather than blindly concatenating strings.
The del| prefix is the part that surprises people in a good way. Those actions remove the tags you're adding from wherever they already are in the text, then add them at the head or tail. So "promote this tag to the front" is one action, not a delete-then-insert dance. That's genuinely the kind of workflow surgery that keeps a big prompt organized.
How it works
The node splits your text on commas, runs each tag through a normalizer (trim spaces, collapse internal runs), and then applies the chosen action:
- add2head - prepends
toadd(as a comma list) to the front - add2tail - appends it to the end
- del|add2head / del|add2tail - first strips any matching tags from the body, then adds
toaddat the chosen position - none - returns
textuntouched
The tag-awareness matters because earlier tags carry more weight in most tag-based encoders. Moving a quality tag like masterpiece or a style token to the head is a real, if subtle, effect - this node makes that a one-click operation.
Inputs and outputs
- text - the prompt string to modify
- toadd - the tag(s) to add, comma-separated for multiple
- action - the dropdown above
- Output: STRING - the modified prompt
Installing it
# ComfyUI Manager: search "ymc suite" and install ymc-node-suite-comfyui
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/YMC-GitHub/ymc-node-suite-comfyui
Restart after installing. Dependencies are four small pure-Python PyPI helpers that self-install; no models, no GPU cost.
Gotchas
- It's designed for comma-separated tag prompts - SDXL-lineage style. On the newer LLM-encoded models, tag order and head-weighting mean less, so "promote to head" is more of a housekeeping move than a quality lever.
- The
del|variants match on the unweighted tag (parentheses and:weightstripped), so(masterpiece:1.2)counts asmasterpiecefor deletion. That's usually what you want, but know it's happening. - The prompt - add weight sibling is the one for attention-weighting a single keyword; this node is for list/tag surgery. Different jobs, don't confuse them.
- WAS-conflict note as with the rest of the pack: if WAS Node Suite is installed too, Manager may flag shared node names between the packs.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| toadd | STRING | — | |
| action | COMBO | 5 options: add2head, add2tail, del|add2head, del|add2tail, none |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |