Nodes/WAS Node Suite v3/Text List Filter
ComfyUI Node Runs on cloud

Text List Filter

Keep the entries of a text list that match a search, or the ones that do not, such as every caption that mentions a woman. Names wired beside the texts, such as file names, are kept in step, so each caption stays paired with its file.

By WASasquatch·Created 4 years ago·Updated 3 days ago· 1,900
Text List Filter
  • texts
  • names
  • texts
  • names
  • text
  • name
  • count
  • removed
◄find►
◄match▾►
◄ignore_casetrue►
◄keep▾►
CategoryWAS Suite/Text/List

Inputs (6)

NameTypeDefaultDescription
textsARRAY,STRINGThe entries to filter: a LIST, such as Text Split to List's, or a STRING list, such as the captions Load Text Batch reads. Each entry is tested whole.
findSTRINGWhat to look for. `woman, girl` = either term; with match `regex` the whole box is one pattern, as `\d+ steps`. Empty matches every entry; match `is empty` ignores it.
matchCOMBO`contains` = a term anywhere; `whole words` = `cat` but not `category`; `starts with` / `ends with` = at either end, spaces aside; `regex` = a regular expression; `is empty` = blank or only spaces.
ignore_caseBOOLEANtrueOn = `Woman` matches `woman`; off = case must match.
keepCOMBO`matching` = keep the entries that match and drop the rest; `not matching` = drop the entries that match, as captions still missing `[trigger]`.
namesoptARRAY,STRINGOptional names running beside texts, one per text, as the filename_list from Load Image Batch. Kept and dropped with their texts. Another count than texts stops the run.

Outputs (6)

NameTypeDescription
textsARRAYThe entries kept, in their order, on one wire for Text List Get, Text List to Text and the other list nodes. Empty when nothing was kept.
namesARRAYThe names of the entries kept, in step with texts. Empty when names is not wired.
textSTRINGThe entries kept as a STRING list, so a node reading it runs once per entry, such as Save Text File. Nothing kept stops the nodes reading it.
nameSTRINGThe names kept as a STRING list, in step with text, for Save Text File's filenames. Stops the nodes reading it when names is not wired or nothing was kept.
countINTHow many entries were kept.
removedINTHow many entries were dropped. 0 = every entry was kept.