PixAI Tagger (Advanced)
Six wires and the thresholds PixAI actually tuned
- images
- character_tags
- general_tags
- style_tags
- copyright_tags
- meta_tags
- rating_tags
The simple node in this pack hands you one string and hides three of the model's six categories. This one hands you all six, each on its own wire, each with its own threshold. If you're captioning a dataset or routing NSFW, that's the difference between usable and not.
What you're getting
Same engine as the simple node: PixAI Tagger v1.0, 30,877 tags, 1008×1008 input, run through transformers with trust_remote_code=True. What changes is the output surface. Instead of merging general, character and style into one blob, you get six outputs:
character_tags, general_tags, style_tags, copyright_tags, meta_tags, rating_tags
Every one is a STRING, one entry per image in the batch, and they stay index-aligned - image 3's general_tags lines up with image 3's rating_tags, which is what makes per-image caption files tractable.
Why the copyright, meta and rating wires matter
rating_tagsis the one the simple node can't give you at all. The rating head knows exactly four labels -rating:g,rating:s,rating:q,rating:e- so you usually get one tag back. That's a clean signal for a switch or an if-branch: sort datasets by explicitness, or send a whole batch down one of two workflows without looking at anything.copyright_tagsis 2,460 franchise and source tags plusoriginal. For a character LoRA, this is often a wire you deliberately drop. Caption a set of one character with the franchise name and you have taught the model to associate the character with the franchise; the usual move is to exclude it or simply not join it.meta_tagsis 145 labels covering medium, provenance, resolution and status - the small set wherewatermark,commentaryandsignaturelive. It's cheap QA for dataset hygiene: spot the images carrying overlay text before they train.
Thresholds, and why these defaults aren't arbitrary
The six defaults - general 0.17, character 0.27, style 0.15, copyright 0.24, meta 0.17, rating 0.41 - are the per-category macro-F1 operating points published with the model, not values invented by the node author. That's worth knowing twice over:
- Someone did the calibration for you, so don't touch them until you've seen the output on your own images.
- They're per-category, which is the whole reason this node exists. The simple node runs style at 0.17 when PixAI recommends 0.15, so it quietly returns fewer style tags than the model is tuned to.
Lower = more tags, higher = more selective, and the widget steps in 0.05. In practice you nudge general_threshold first - tag density lives there - and leave rating_threshold alone.
Wiring the outputs
There's no combined output here, so you join things yourself. The prompt-shaped caption is general + character + style through a text-concat node - same three categories the simple node merges, just with style on its own threshold now. rating and meta are usually consumers rather than caption fodder: they drive a branch, get logged, or trigger a skip.
Also worth knowing: this node has no trailing_comma option. The simple one does. If your downstream trainer wants one, add it after the join.
Shared with the simple node: replace_underscore (the vocabulary stores long_hair; turn it on if your captions use spaces), and unload_model to drop the tagger when the sampler wants the card back.
Install
ComfyUI Manager, search ComfyUI PixAI Tagger, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/warwk/ComfyUI-PixAI-Tagger.git
pip install -r requirements.txt
Dependencies are transformers, timm, huggingface_hub, numpy, Pillow. Torch is deliberately absent from that list - ComfyUI manages its own PyTorch, so don't reinstall it for this pack. First run downloads pixai-labs/pixai-tagger-v1.0 (~1.95 GB) to your HF cache; it is not bundled with the repo.
Where people get burned
- An empty output is normal. Nothing passing the threshold gives you an empty string, not null. A branch that expects content should test for length, not existence.
- Exclusion runs after underscore replacement.
long_hairinexclude_tagswill not match ifreplace_underscoreis on - the string being compared islong hair. Case doesn't matter, the underscore form does. trust_remote_code=Trueandtimm. The model repo ships its own pipeline class. Offline or locked-down Hugging Face setups fail here, and a missingtimmbreaks the remote code rather than the node.- A 1008² model at 486M parameters is not fast. Great as a batch job over a folder of images; not what you want in an interactive loop.
unload_modelon, and let it work while you make coffee. - Anime illustrations only, per the model's own limitations, cutoff May 2026.
One last honest note: tagging is the mechanical half of captioning. The durable practice pairs a tagger with a describer - Florence-2 for speed, JoyCaption for richer language - and concatenates, because tags pin the vocabulary the base was trained on and prose catches the scene they can't.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The input images to be tagged. | |
| model | COMBO | pixai-labs/pixai-tagger-v1.0 | The model to use for tagging. Currently pixai-labs/pixai-tagger-v1.0 is the only available model. |
| character_threshold | FLOAT | 0.270–1 | Threshold for character tags. Lower values will include more tags, higher values will be more selective. Default is 0.27. |
| general_threshold | FLOAT | 0.170–1 | Threshold for general tags. Lower values will include more tags, higher values will be more selective. Default is 0.17. |
| style_threshold | FLOAT | 0.150–1 | Threshold for style tags. Lower values will include more tags, higher values will be more selective. Default is 0.15. |
| copyright_threshold | FLOAT | 0.240–1 | Threshold for copyright tags. Lower values will include more tags, higher values will be more selective. Default is 0.24. |
| meta_threshold | FLOAT | 0.170–1 | Threshold for meta tags. Lower values will include more tags, higher values will be more selective. Default is 0.17. |
| rating_threshold | FLOAT | 0.410–1 | Threshold for rating tags. Lower values will include more tags, higher values will be more selective. Default is 0.41. |
| replace_underscore | BOOLEAN | false | If enabled, underscores in tags will be replaced with spaces. |
| unload_model | BOOLEAN | false | If enabled, the model will be unloaded after tagging. |
| exclude_tags | STRING | A comma-separated list of tags to exclude from the results. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| character_tags | STRING | — |
| general_tags | STRING | — |
| style_tags | STRING | — |
| copyright_tags | STRING | — |
| meta_tags | STRING | — |
| rating_tags | STRING | — |