TagCategory
What categories does this tag string actually contain?
- categories
TagCategory is the pack's inspection tool. Feed it a tag string and it tells you which categories those tags belong to, comma-separated, deduplicated and sorted. It doesn't filter anything, doesn't change anything - it just answers the question you'll ask five minutes after installing this pack: "wait, what category is smile actually in, and what the hell category names even exist around here?"
That makes it the debugging companion to everything else in the family. TagFilter and TagSelector silently keep or drop tags based on category membership, and when a tag goes missing you have no idea why. Wire the same tag string into TagCategory and you'll see exactly what the category file thinks each tag is: smile → face, pose, expression, brown_hair → hair, hair_color, color, long_hair → hair, hair_style. Suddenly the mystery of why the filter dropped your clothing tags is solved - they were classified under clothes, not clothing.
How it works
Single input (tags), single output (categories). Every tag is normalized the pack way - lowercase, spaces to underscores - then looked up in the bundled category file (the code reads the big tag_category_v3.json by default). Each tag contributes its full category list, duplicates are removed, and the result is a sorted, comma-joined string. If a tag isn't in the file at all, it contributes nothing - which is itself useful information: an empty-ish result usually means your tags are unknown to the file, not that you wired something wrong.
The output is a plain STRING, so it's easy to chain: run TagCategory, then use TagSelector with the output as its category list to build a "keep exactly what was classified" pass, or eyeball it in a text display node to understand your tagger's vocabulary.
Two things worth knowing
First, the output lists categories, not tags - this node can't tell you which tags carried a given category, just that the category appears somewhere in the string. If you need tag-level attribution, that's TagDetector or a manual look at the JSON.
Second, the same best-effort-data caveat applies here that applies everywhere in this pack: the category files were auto-generated by an AI and are being hand-corrected over time, so a wrong category here is the source of downstream surprises, not a bug in this node. If TagCategory disagrees with your intuition about a tag, trust the JSON - that's what every other node in the pack reads.
Install
Nothing special, because it's the same pack as always: ComfyUI Manager search "comfyui_tag_filter", or
cd ComfyUI/custom_nodes
git clone https://github.com/sugarkwork/comfyui_tag_fillter
restart, done. No dependencies, no models, no downloads beyond the repo itself. It's a tiny utility, but it's the one you'll keep open in a corner of the graph while you tune the real filtering.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| tags | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| categories | STRING | — |