Nodes/ComfyUI-list-filter/Find Not Any Strings
ComfyUI Node

Find Not Any Strings

Keep every tag line that avoids your blacklist

By Kesin11·Created 2 years ago·Updated about a year ago· 1
Find Not Any Strings
    • not_found_index_list
    • not_found_string_list
    string_list
    search_strings
    delimiter,

    Find Not Any Strings is the inverse of its sibling Find Any Strings, and it's the node you reach for when you want to exclude things. Give it a list of strings and a blacklist of terms, and it returns the positions of every entry that contains none of them - plus the entries themselves.

    The motivating workflow is the same WD14-Tagger pipeline as the rest of this pack: every image in a batch gets a tag line, and you want the images that don't carry certain tags. "Skip anything tagged blurry, lowres, or watermark." This node finds the survivors, hands their indices to Filter Image List, and suddenly your batch processing is quietly skipping the junk instead of making you eyeball it.

    How it works

    search_strings is split on the delimiter and each term is stripped, exactly like Find Any Strings. Then each string in the list is tested with all(search not in s for search in search_list) - every search term must be absent. Same rules as its counterpart: matching is substring and case-sensitive. A blacklist entry of "cat" also excludes "scatter", and "Blurry" will not catch a lowercase "blurry" tag.

    The inputs that matter

    • string_list - the list of strings to search (Tagger output, prompt lines, whatever you're filtering).
    • search_strings - the blacklist, delimiter-separated.
    • delimiter - splits the blacklist, default ",".

    Two outputs: not_found_index_list (INT list) feeds Filter Image List or Filter String List to keep only the passing entries, and not_found_string_list (STRING list) shows you what survived - useful for a ShowText sanity check.

    Installing it

    Standard for this pack - it ships as one of six nodes in ComfyUI-list-filter:

    • ComfyUI Manager - search ComfyUI-list-filter, install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/Kesin11/ComfyUI-list-filter, then restart ComfyUI.

    No requirements.txt, no model files, no GPU deps. The whole pack is dependency-free Python, so there's nothing extra to install and nothing for it to conflict with.

    The gotchas, and they're the mirror of Find Any Strings

    • Empty blacklist = empty result. Leave search_strings blank and the split produces one empty string, "" not in s is false for every string, and you get zero hits. Which, crucially, is the correct inversion of Find Any Strings' empty-field trap (there, blank meant "match everything"). Just make sure your blacklist actually has content.
    • Watch the interaction with Filter Image List. If you wire these survivors into Filter Image List and the result comes up empty, its return_first_if_none default will quietly hand you the first image anyway. An all-excluded batch can silently become "the first image" instead of nothing. If that matters, flip that input off.
    • Same substring and case-sensitivity rules as its sibling - your blacklist terms are literal fragments, not exact tags.

    It's a small node with one clear job: keep the batch clean by subtraction. In tagging-heavy workflows it pairs perfectly with Find Any Strings - one to say "keep these," the other to say "drop those," both feeding the same filter nodes.

    Categorylist-filter

    Inputs (3)

    NameTypeDefaultDescription
    string_listSTRINGThe list of strings to search in.
    search_stringsSTRINGThe list of strings to search for.
    delimiterSTRING,The delimiter used to split the search strings.

    Outputs (2)

    NameTypeDescription
    not_found_index_listINTThe list of indices where search strings are not found.
    not_found_string_listSTRINGThe list of strings where search strings are not found.