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.
Text List Filter
- texts
- names
- texts
- names
- text
- name
- count
- removed
◄find►
◄match▾►
◄ignore_casetrue►
◄keep▾►
CategoryWAS Suite/Text/List
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| texts | ARRAY,STRING | The 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. | |
| find | STRING | What 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. | |
| match | COMBO | `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_case | BOOLEAN | true | On = `Woman` matches `woman`; off = case must match. |
| keep | COMBO | `matching` = keep the entries that match and drop the rest; `not matching` = drop the entries that match, as captions still missing `[trigger]`. | |
| namesopt | ARRAY,STRING | Optional 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)
| Name | Type | Description |
|---|---|---|
| texts | ARRAY | The 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. |
| names | ARRAY | The names of the entries kept, in step with texts. Empty when names is not wired. |
| text | STRING | The 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. |
| name | STRING | The 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. |
| count | INT | How many entries were kept. |
| removed | INT | How many entries were dropped. 0 = every entry was kept. |