Nodes/ComfyUI-Pixaroma/Text Match Pixaroma
ComfyUI Node

Text Match Pixaroma

Text Match Pixaroma - checks whether a text contains one of your words, and lets a workflow act on the answer. Wire any text into text (an AI answer, a prompt, a file name) and type the words to look for, one per line or separated by commas. It gives a yes / no (match), the number of the word that matched (index, 1 for the first word, 0 for none) and the word itself. Wire a picture or anything else into value and two gates appear: if_match lets it through only when the text matches, if_no_match only when it does not. Nothing after a closed gate runs, and there is no error. With a vision model asked 'Is the face sharp? Answer yes or no' in front, a whole folder is filtered in one Run: only the matching pictures reach the save node. With nothing wired into value, the gates pass the text itself. Matching is plain text, never a code pattern. Whole words is on by default, so 'cat' does not match 'category'; upper and lower case are the same unless you turn that off.

By pixaroma·Created 7 months ago·Updated a day ago· 426
Text Match Pixaroma
  • value
  • match
  • index
  • word
  • if_match
  • if_no_match
◄text—►
◄wordsyes►
◄modecontains any word►
◄ignore_casetrue►
◄whole_wordstrue►
Category👑 Pixaroma/🔀 Logic & Flow

Inputs (6)

NameTypeDefaultDescription
textSTRINGThe text to check, for example an AI Prompt answer, a prompt or a file name.
wordsSTRINGyesThe words or phrases to look for: one per line, or separated by commas. The first one is number 1 for the index output.
modeCOMBOcontains any wordcontains any word = at least one of them is in the text. contains all words = every one of them is. is exactly one of them = the whole text is one of the words (spaces, full stops and quotes around it are ignored, so 'Yes.' counts as yes). starts with one of them = the text begins with one of the words.
ignore_caseBOOLEANtrueOn: Yes, YES and yes are the same.
whole_wordsBOOLEANtrueOn: a word only counts on its own, so 'cat' does not match 'category'. Off: it may be part of a longer word.
valueopt*Optional. Anything to let through only on a match (if_match) or only without one (if_no_match): a picture, a prompt, a latent. Not wired: the gates pass the text.

Outputs (5)

NameTypeDescription
matchBOOLEANTrue when the text matches your words, False when it does not.
indexINTThe number of the word that matched (1 for the first word in the list), 0 when none did.
wordSTRINGThe word that matched, or nothing.
if_match*The value (or the text) when it matches. Without a match nothing after it runs.
if_no_match*The value (or the text) when it does NOT match. With a match nothing after it runs.