Nodes/ComfyUI Gender Tag Filter/Dedupe Tags 🏷️
ComfyUI Node

Dedupe Tags 🏷️

The boring cleanup node that ships inside a gender filter pack

By senjinthedragonΒ·Created 6 months agoΒ·Updated 5 months agoΒ· 0
Dedupe Tags 🏷️
    • text
    β—„textβ€”β–Ί
    β—„case_sensitivefalseβ–Ί

    Dedupe Tags is the least glamorous node in the comfyui-gender-tag-filter pack, and honestly the one I reach for first. It takes a comma-separated tag string and removes duplicates, keeping the first occurrence of each. That's it. But once you're running a real pipeline - a static quality-tag prefix concatenated with TIPO expansion, or a merged string from a few different prompt-builder nodes - you'll be amazed how much junk accumulates. masterpiece appearing four times isn't just ugly, it's wasted prompt budget, and duplicate tags can nudge weighting in ways you don't notice until you diff the outputs.

    The reason it lives in this pack instead of some generic utilities pack is that it shares the gender pack's parsing machinery, and that machinery is genuinely good. It treats underscores and spaces as the same separator, so big_breasts and big breasts are correctly seen as the same tag no matter which style upstream produced. It's case-insensitive by default, so Big_Breasts and big breasts also collapse. And it's emphasis-aware: (large_breasts:1.3) and large_breasts are identified as duplicates, with the first occurrence - including its emphasis weight - winning. A1111/Forge syntax like (tag:1.3), ((tag)), and [tag] is parsed correctly throughout, and LoRA syntax plus BREAK keywords pass through untouched.

    What you set

    Two inputs, both obvious:

    • text - the comma-separated tag string to dedupe.
    • case_sensitive (off by default) - flip it on if you genuinely want big_breasts and Big_breasts treated as different tags. You almost certainly don't; leave it off.

    The output is a single text STRING with duplicates removed, rejoined with , . Since it's a STRING-to-STRING node, it slots anywhere in your tag chain without adapter nodes. The pack's own recommended wiring puts it right before Gender Tag Filter, so the gender node isn't wasting effort re-scanning duplicate anatomy tags it already handled.

    The honest caveats

    The input must be comma-separated - that's a deliberate design decision, the old delimiter input was removed in v1.2.0 and it's commas or nothing. Newlines inside the string are treated as boundaries rather than separators, so feed it a single-line tag list. And because it keeps the first occurrence, order matters: if you want your quality prefix to survive, put it first in the string, which is exactly where static prefixes usually live anyway.

    Installing

    Same one-liner as the rest of the pack - ComfyUI Manager (search "Gender Tag Filter") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/senjinthedragon/comfyui-gender-tag-filter
    

    Restart, and it's under utils/tags. No extra dependencies, no model downloads - this node runs on pure string parsing, so it's also the pack's most portable piece. If you're only here for the dedupe, that's fine. It's a small utility done well, and small utilities done well are what keep big workflows from rotting.

    Categoryutils/tags

    Inputs (2)

    NameTypeDefaultDescription
    textSTRINGβ€”
    case_sensitiveoptBOOLEANfalseβ€”

    Outputs (1)

    NameTypeDescription
    textSTRINGβ€”