ComfyUI Node

TagRemover

Delete one tag, leave the rest of the prompt alone

By sugarkwork·Created 2 years ago·Updated 6 months ago· 87
TagRemover
    • result
    tags
    exclude_tags

    TagRemover is the exact-match eraser for your prompt. You hand it a tag string and a list of tags to drop, and it returns the string minus those tags - nothing else touched, nothing reordered, no AI guessing about what you meant. It sounds trivial until you're staring at a WD14 tagger dump that's 40 tags long and you need every *_ears tag gone without nuking the rest of the prompt by hand.

    What it actually does

    Two string inputs, one string output, and the logic is a single filter: parse both lists, keep every tag that isn't in the exclude_tags list, rejoin with commas. That's the whole mechanism, and the simplicity is the point - it's deterministic, which is exactly what you want when you're scrubbing prompts.

    The subtle part is how tags are compared. This pack normalizes everything before matching: lowercase, spaces become underscores. So long hair in one field and long_hair in the other are the same tag to it. And because comparison happens on the normalized format, not the display text, dropping long_hair also removes (long_hair:1.2) - a weighted emphasis gets stripped along with its parentheses. If you've ever fought with regexes to strip emphasis syntax, that's a genuinely nice convenience.

    The README's suggested use is chaining it after a category filter: strip only the expression tags, or only the color tags, while keeping the rest of the image description intact. It works just as well on a negative prompt.

    The inputs that matter

    Only two:

    • tags - the prompt you're cleaning.
    • exclude_tags - the tags to remove, comma-separated. Multiple is fine.

    Output is result, a STRING. Feed it forward into whatever merges or encodes your prompt.

    Where people get burned

    Matching is exact and whole-tag. A typo, a different spelling, or a hyphen where the model uses an underscore and the tag survives - you'll stare at the output wondering why it's still there. There's no substring or fuzzy match in this node (that's what the sibling TagWildcardFilter is for). Also note it's removal only: if a tag in exclude_tags isn't in the prompt, nothing happens. No error, no complaint, just silence.

    One more quirk worth knowing: this pack treats parentheses as emphasis syntax, so if a tag legitimately contains a parenthesis in its name (like blue_eyes_(color)), you want to match it against the normalized form. When in doubt, copy the exact tag out of the pack's tag_category.json file and paste it in.

    Install

    It's part of the single comfyui_tag_filter repo. ComfyUI Manager: search "comfyui_tag_filter". Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sugarkwork/comfyui_tag_fillter
    

    Restart after. The pack has zero dependencies and no model downloads - it's pure Python string handling over the bundled category JSON files.

    Categorytext

    Inputs (2)

    NameTypeDefaultDescription
    tagsSTRING
    exclude_tagsSTRING

    Outputs (1)

    NameTypeDescription
    resultSTRING