ComfyUI Node

Unique Tags

Strip the duplicate tags out of your prompt in one node

By nestflow·Created about a year ago·Updated about a month ago· 5
Unique Tags
    • tags
    input_tags

    Unique Tags is the little cleanup utility that ships in the nestflow/ComfyUI-Booru-Tagger pack, and it does exactly one thing: take a comma-separated tag string and hand back the same tags with duplicates removed, in their original order.

    It's unglamorous, and it's also the kind of node you quietly get real use out of. Duplicate tags show up all the time once you're stitching prompts together - you concatenate the general_tags and character_tags outputs of the Booru Tagger node, or you merge a saved prompt with a fresh interrogation, and suddenly 1girl appears three times and long hair twice. It's not just ugly; duplicates silently double- or triple-weight a concept in the attention, and they eat prompt budget that a 75-token CLIP limit charges you for. Running the combined string through this node fixes both in one step.

    How it works

    There's no model and no inference, just text processing. It splits the input on commas, trims whitespace, drops empty entries, and keeps the first occurrence of each tag before rejoining everything with ", ". First occurrence wins, so whatever ordering you had is preserved - which matters, because on Danbooru-trained models earlier tags get stronger attention. If you'd hand-ordered your prompt, this node won't reshuffle it; it only removes the repeats.

    Input and output

    The whole interface is two ports:

    • input_tags - a plain STRING field. Paste your tag soup in, or wire it from wherever the tags are coming from.
    • tags - the deduplicated string, in the same order. Note this is a single string, not a list - don't expect per-tag list semantics here.

    Wire tags into a Save Text or Preview Text node to eyeball the result, or into whatever prompt-assembly node your workflow uses before the CLIP Text Encode.

    Install

    It comes free with the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/nestflow/ComfyUI-Booru-Tagger
    

    Or search "Booru Tagger" in ComfyUI Manager. Same caveats as the rest of the pack: it's written on ComfyUI's Node v3 API, so it needs a recent ComfyUI, and the full onnxruntime + pandas deps install regardless - the heavier nodes in the pack need them even if this one doesn't.

    That's the whole thing. It's a deliberately thin utility with nothing to configure - dedupe, rejoin, done.

    CategoryBooruTagger

    Inputs (1)

    NameTypeDefaultDescription
    input_tagsSTRING

    Outputs (1)

    NameTypeDescription
    tagsSTRING