Nodes/ComfyUI-AI-Assistant/Prompt Blacklist
ComfyUI Node

Prompt Blacklist

The Surgical Cousin of Clean Prompt Tags — Remove Exact Tags, Not Substrings

By JackEllie·Created 2 years ago·Updated 2 years ago· 24
Prompt Blacklist
    • string
    • show_help
    string
    Blacklist_Prompt

    Prompt Blacklist is the exact-match sibling of the same pack's Clean Prompt Tags. Where Clean Prompt Tags removes any tag containing a word, this one removes tags that match your blacklist entries directly - the surgical option for when you want lineart gone but lineart_style kept. In a Danbooru-tag ecosystem where tags are precise identifiers, exact matching is often what you actually want, because a blacklist is usually about specific tags you're tired of seeing, not whole families.

    The author's example is clear: base prompt masterpiece, best quality, lineart, sketch, transparent background, blacklist of lineart, sketch, output masterpiece, best quality, transparent background. Clean and predictable.

    How it works

    Mechanically it's simple: your base prompt gets split on commas, and each tag is checked against the blacklist string. If a tag's full text appears inside the blacklist, it's dropped; everything else survives, and the survivors are re-joined with ", ". Because the check is whole-tag, sketch won't take out sketch_style the way Clean Prompt Tags would. Note the matching is case-sensitive - Lineart in the blacklist won't remove lineart in the prompt. It's the kind of node where you'll quickly learn to paste exactly what you see in your prompt.

    The one subtlety: it checks whether the tag text appears anywhere in the blacklist string, not as a clean comma-separated token. In practice, with comma-separated entries like the author intends, that behaves exactly like whole-tag matching. But keep your blacklist entries tidy - a stray character can change what matches.

    The inputs and outputs

    Two multiline text inputs: string is your base prompt (marked forceInput, so you can wire it from a text node), and Blacklist_Prompt is your comma-separated list of tags to remove. Outputs are string - the filtered prompt, which goes straight into your CLIP Text Encode - and show_help, a text reminder of the usage pattern. Empty blacklist means nothing is removed.

    Installing it

    It's one of six nodes in JackEllie/ComfyUI_AI_Assistant, a small fork of tori29umai0123's AI-Assistant. ComfyUI Manager, search "ComfyUI-AI-Assistant", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JackEllie/ComfyUI_AI_Assistant
    

    Restart after. No model downloads - pure CPU text processing. Requirements are just opencv-python, plus a top-level skimage import in the module, so if the pack fails to load entirely, pip install scikit-image is the usual fix.

    When to reach for it

    This is the node to use when you know the exact tags you're sick of - lineart, sketch, worst quality, a watermark tag - and you want them stripped without collateral damage. It's also handy in batch or AB-testing setups where you want to toggle a tag's presence without editing the prompt string by hand. If you instead need "remove everything containing this color word," that's Clean Prompt Tags. Together the two cover prompt hygiene end to end; this one is just the one that doesn't surprise you.

    Categoryadvanced/AI_Assistant/text

    Inputs (2)

    NameTypeDefaultDescription
    stringSTRING
    Blacklist_PromptSTRING

    Outputs (2)

    NameTypeDescription
    stringSTRING
    show_helpSTRING