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

Tag Remover [LP]

Cutting specific tags out of a prompt string

By LevelPixel·Created 2 years ago·Updated 6 months ago· 31
Tag Remover [LP]
    • result
    tags
    exclude_tags

    Where the pack's RemoveDuplicateTags-LP cleans up accidental repeats, this node is for when you know exactly which tags you don't want and want them gone - a blunt, explicit exclusion tool rather than a smart categorized filter.

    Why you'd reach for it

    Tag-based prompting (the Danbooru-style vocabulary that Illustrious, NoobAI, and similar checkpoints expect) often assembles a prompt from more than one source, and not everything that shows up belongs there. An autotagger might keep spitting out watermark or text tags you never asked for and don't want in a LoRA caption set. A character sheet template might carry a rating tag you specifically want stripped before the prompt reaches somewhere that shouldn't see it. In both cases, you know the offending tags by name - you don't need a fuzzy categorized filter, you need "remove these, exactly."

    Worth noting: the pack's README does describe a more elaborate categorized tag-filtering system elsewhere (borrowed from a separate comfyui_tag_fillter project, letting you keep or drop whole categories of tags like "background" or "character"). This node is the simpler sibling to that idea - literal string matching against a list you provide, not category-aware filtering.

    The inputs and outputs that matter

    • tags - the full tag string you're cleaning up.
    • exclude_tags - the tags you want removed, presumably in the same delimited format as tags itself.
    • Output - result, a STRING with the excluded tags stripped out.

    This node is also flagged as an output node in its schema, meaning it always executes even if nothing is wired to result downstream - handy if you're using it as a verification/display step rather than feeding the cleaned string onward.

    How to install it

    ComfyUI Manager: search "ComfyUI Level Pixel" or ComfyUI-LevelPixel, install, restart - auto-updates through Manager's "Update ALL." Manual:

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

    Restart ComfyUI. Pure text processing, no models, no extra dependencies.

    Common issues & troubleshooting

    A tag you listed in exclude_tags isn't actually being removed. This is almost certainly an exact-match problem - the same landmine as its RemoveDuplicateTags-LP sibling. blue_sky vs. blue sky, or different casing between the two fields, reads as two different strings even though they mean the same thing to a person. Match formatting exactly between tags and exclude_tags, including underscores vs. spaces.

    You're cleaning up a prompt from several sources and both duplicates and unwanted tags are a problem. Run the string through both of this pack's tag nodes in sequence - RemoveDuplicateTags-LP to collapse repeats, TagRemover-LP to strip specific unwanted tags - rather than trying to solve both problems with one node.

    Nothing errors, but you're not sure the node actually ran. Since it's an output node, it executes unconditionally - if you're troubleshooting whether it fired, check the console log or wire its result output into a Show Text node temporarily to confirm what it produced.

    CategoryLevelPixel/Tags

    Inputs (2)

    NameTypeDefaultDescription
    tagsSTRING
    exclude_tagsSTRING

    Outputs (1)

    NameTypeDescription
    resultSTRING