TagComparator
What's unique to each, what they share
- tags1_unique
- tags2_unique
- common_tags
TagComparator is the pack's diff tool: two tag strings in, three strings out - the tags only in the first set, the tags only in the second, and the tags both share. If you've ever wondered "what did this batch add to my base prompt?" or "which tags did the tagger disagree on between these two images?", this is the node that answers it.
The author's README says, with disarming honesty: "I don't know what it's for." He's being modest - set theory on tag sets is genuinely useful - but he's also right that it's a tool you reach for occasionally rather than one you build a workflow around. The three outputs are exactly the set difference and intersection:
- tags1_unique - tags in set 1 but not set 2.
- tags2_unique - tags in set 2 but not set 1.
- common_tags - tags present in both.
Matching is tag-by-tag on normalized form - lowercase, spaces to underscores - so long hair and long_hair count as the same tag. Emphasis weights survive in the output; a (smile:1.2) that appears in both sets keeps its weighting in common_tags.
Where it earns its keep
The realistic use is debugging, not generation. Two tagger runs on the same image under different settings (WD14 vs. a threshold tweak, or two different taggers) - run both outputs through TagComparator and see exactly what the settings changed instead of eyeballing two long strings. Or compare a raw tagger output against your curated base prompt to see which tags your pipeline is injecting that you didn't intend. And the three ports compose: wire common_tags into your prompt and tags1_unique into a separate conditioning to literally split a prompt into shared and image-specific parts.
Gotchas
Both inputs are required - no empty-input tolerance here, unlike the mergers. Duplicates within a single input aren't collapsed before comparison, though in practice the pack's parse-and-reemit tends to keep them, so run inputs through a merger first if you suspect duplicates. And remember it's pure string matching: long_hair and long_hair match, but long_hair and long hair only match after normalization kicks in. Case differences are handled; spelling differences are not.
Install
Same pack, same steps: ComfyUI Manager search "comfyui_tag_filter", or
cd ComfyUI/custom_nodes
git clone https://github.com/sugarkwork/comfyui_tag_fillter
Restart. No dependencies, no model downloads - a couple of list comprehensions and a re-serialize, so it's fast enough to leave in a loop. It's the quiet diagnostic node of the family: unglamorous, occasionally indispensable.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| tags1 | STRING | — | |
| tags2 | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| tags1_unique | STRING | — |
| tags2_unique | STRING | — |
| common_tags | STRING | — |