prompt - search
Keep only the prompt tags that match
- STRING
prompt - search is a filter, not a finder. Feed it a prompt and a search term, and it returns only the tags that contain that term - a prompt reduced to its matching subset. The obvious use is inspection ("what hair tags does this prompt actually have?"), but the smarter use is routing: extract the pose tags, then branch the workflow on whether they exist.
It's one of the quieter nodes in the ymc text family, and honestly one of the more underrated ones. The pack's advanced sibling does the destructive operations (delete, move, replace); this one just looks.
How it works
Mechanically it's a per-tag substring match. The node splits your prompt on commas, and for each tag checks whether any of the comma-separated patterns in search appears inside that tag (before matching, tags are stripped of (parentheses) and :1.2 weights - so (white hair:1.1) matches a search for white hair). Tags that hit are kept, in original order; everything else is dropped.
Two things to internalize:
- It's substring, not exact-word. Searching
hairmatcheswhite hair,long hair, and alsohairpin. Useful and slightly dangerous in equal measure. - Any pattern in the search list can match. Comma-separate patterns and each tag is checked against all of them.
The output is just a string - which means an empty result is an empty string, and that's a perfectly valid signal to branch on downstream.
Inputs and outputs
text- the prompt to filtersearch- comma-separated patterns; a tag survives if it contains any of themSTRINGoutput - the matching tags, comma-separated, original order
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; the pack's auto-install is commented out). No models, no GPU.
Find it by canvas search (prompt / search) or the right-click ymc suite menu.
Common issues
- "It matched something I didn't want." Substring matching strikes again.
catmatchescatalogandblack catboth. If you need exactness, search the full tag - or accept the fuzzy nature of this node. - "It returned nothing and I swear the tag is there." Check whitespace:
long hairwith a trailing space won't substring-matchlong hair... actually, since the tag is trimmed before matching, this is mostly handled - the more likely culprit is matching against a weighted tag form the search doesn't contain.(long hair:1.2)unweights tolong hairbefore matching, so weights are handled. - WAS Node Suite conflicts on the pack's io/save nodes can show up as warnings if you run both packs - unrelated to this node.
If you need the full edit toolkit - delete what matched, move it to the front, or replace it - step up to prompt - search (adv), which wraps this filter plus all the destructive actions into one node.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| search | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |