Nodes/ComfyUI Level Pixel/Tag Category Remover [LP]
ComfyUI Node

Tag Category Remover [LP]

Drop whole categories of tags, keep everything else

By LevelPixel·Created 2 years ago·Updated 5 months ago· 31
Tag Category Remover [LP]
    • result
    tags
    exclude_categories

    This pack ships three different ways to act on tag categories, and it's easy to grab the wrong one. Tag Category Filter does both keep-and-drop in one node. Tag Category Keeper only keeps the categories you name. Tag Category Remover is the mirror image of Keeper: it only drops. Name a few categories you don't want, and everything else survives untouched.

    What it does

    You pass in a tag string and a list of categories to exclude, and it strips out any tag that falls into one of those categories, leaving the rest exactly as it was. The categorization logic underneath is the same one the whole Tags family shares, credited in the README to comfyui_tag_fillter. The practical use case is the inverse of the README's "background" example: instead of isolating one category, you're pulling out the categories you don't want cluttering a prompt - say, stripping Meta tags like highres or absurdres out of a caption set before it goes anywhere that cares about content, not formatting flags.

    Same caveat as its Filter and Keeper siblings applies here: neither the README nor the schema documents the actual list of valid category names this pack recognizes, beyond the one "background" example. Danbooru's own convention groups tags into General, Character, Artist, Copyright, and Meta, which is a reasonable reference point, but whether this node's categorizer follows that split exactly isn't confirmed anywhere. If this pack's Tag Category node is installed alongside it, running your tags through that one first to see what category labels actually come out is the fastest way to stop guessing.

    Inputs and outputs that matter

    • tags (required, defaults to empty) - your full tag string.
    • exclude_categories (required, defaults to empty) - the categories you want stripped out; anything not in one of these categories passes through unchanged.

    Output: result - the tag string with the excluded categories removed.

    Installing it

    Through ComfyUI Manager, search "ComfyUI Level Pixel" or "ComfyUI-LevelPixel." Manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/LevelPixel/ComfyUI-LevelPixel.git
    

    Restart ComfyUI. No models, no extra dependencies - it's string processing.

    Which of the three you actually want

    Quick decision guide, since all three live in the same category and do overlapping things:

    • Only want a handful of categories, throw away the rest → Tag Category Keeper.
    • Only want to drop a handful of categories, keep the rest → this node.
    • Need to both keep some and separately exclude others in one pass → Tag Category Filter.

    If you find yourself chaining a Keeper into a Remover to get both effects, that's a sign Filter is the node you actually wanted - it does both levers in a single step.

    Common issues & troubleshooting

    Nothing seems to get removed. By far the most likely cause is typing a category name that doesn't match what the underlying categorizer actually recognizes for your tag set - you get an unchanged string back with no error telling you the name was wrong. Confirm the node is doing anything first with a category name you're confident exists (the README's own worked example, "background," is the safest starting point if your tags include a background description), then work outward.

    Leaving exclude_categories empty. Presumably a pass-through - nothing named to exclude means nothing gets excluded - but that's inferred from the node's shape, not documented explicitly, so don't assume it if the node seems to be silently altering things you didn't expect it to touch.

    Formatting mismatches between your tags and what the categorizer expects. Tag categorization tools built around Danbooru-style vocabularies are typically sensitive to underscore-vs-space formatting (blue_sky vs blue sky) - if a tag you expected to get caught by a category isn't, that's worth checking before assuming the category name itself is wrong.

    CategoryLevelPixel/Tags

    Inputs (2)

    NameTypeDefaultDescription
    tagsSTRING
    exclude_categoriesSTRING

    Outputs (1)

    NameTypeDescription
    resultSTRING