prompt - search (adv)
Search, delete, reorder or replace tags in one pass
- STRING
This is the workhorse of the ymc prompt family - the one node that does search, delete, reorder, and replace, all behind a single action dropdown. If you only install one prompt-editing node from this pack, make it this one. It's prompt - search (the pure filter) with teeth.
The killer use case is ordering. On SDXL-lineage anime models, earlier tags get stronger attention - so "move my character and pose tags to the front" is a real quality lever, not a cosmetic one. This node does that in one click, and it can also strip a whole category of tags or rename a tag everywhere it appears.
How it works
The flow is always: search first, then act. The node finds every tag in text that contains any pattern from the comma-separated search list (matching is substring-based, and tags are unweighted before comparison, so (1girl:1.2) still matches 1girl). Then action decides what happens to those matched tags:
search- just return the matches (same as plainprompt - search)del- remove the matched tags from the promptmove2head- move matched tags to the front, rest follows in ordermove2tail- move matched tags to the backreplace- swap every matched tag for thereplacestringnone- returntextunchanged (a bypass)
Because each action starts from the same search, the same search/text pair can feed several of these nodes with different actions - a quick way to see "what would this prompt look like without hair tags" vs "with hair tags first" without editing anything.
Inputs and outputs
The ones you'll actually set:
text- the prompt to editsearch- the comma-separated patterns that select tagsaction- one of the six operations abovereplace- the string used whenactionisreplace
Single STRING output: the transformed prompt.
Installing it
Part of ymc-node-suite-comfyui:
- ComfyUI Manager → search
ymc-node-suite-comfyui→ Install → restart, or
cd ComfyUI/custom_nodes
git clone https://github.com/YMC-GitHub/ymc-node-suite-comfyui
restart, and pip install -r requirements.txt on a manual clone (four yors_* helper libs; auto-install is commented out). No models, no GPU.
Search prompt / search on the canvas or use the right-click ymc suite menu.
Common issues
- Substring matching bites twice.
move2headwithhairalso moveshairpin. Check what actually matched by runningaction = searchfirst and eyeballing the output - that's the built-in debug step. replacereplaces whole tags, not substrings. Searchinghairand replacing withfurturnslong hairintofur(the whole tag is swapped), notlong fur. If you want in-tag edits, you're in the wrong node.- Empty matches are harmless. If nothing matches,
del/replace/move*all return the prompt essentially unchanged - safe to leave wired up. - WAS Node Suite conflicts on the pack's io/save nodes can appear as Manager warnings if you run both packs - unrelated to this node.
For plain deletion only, the pack's prompt - del is simpler; for a pure filter, prompt - search. But the moment you want to reorder or replace, this is the one.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| search | STRING | — | |
| action | COMBO | 6 options: none, del, move2head, move2tail, replace, search | |
| replace | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |