ComfyUI Node

PixAI Tagger

The newer anime tagger that also names the series

By adbrasi·Created 7 months ago·Updated 4 months ago· 1
PixAI Tagger
  • image
  • tags
backendpytorch
batch_size4
threshold0.30
character_threshold0.85
separator,
exclude_tags
include_iptrue
replace_underscorefalse
trailing_commafalse
force_downloadfalse
deviceauto
fp16true
pytorch_repo_idpixai-labs/pixai-tagger-v0.9
onnx_repo_iddeepghs/pixai-tagger-v0.9-onnx
hf_token

Most anime taggers answer "what's in this image?" with a flat list of tags. The PixAI Tagger is the one that also answers "which series is that character from?" It's a newer reverse-tagging model from PixAI (pixai-labs/pixai-tagger-v0.9), and its hook is an IP (intellectual-property / series) mapping: when it tags a character at high confidence, it can look up which franchise that character belongs to and append the series tag too. For captioning anime training data, that's a genuinely useful trick - series tags are exactly the thing generic taggers tend to get wrong or drop.

Early community coverage called it roughly 1.3x more performant than a regular tagger, and it does bring one thing WD14 simply doesn't: real copyright/series tagging, on top of the usual character and general tags. It's the newest and most ambitious of the three taggers in the booru-helper-mini pack, and also the one with the most setup friction - which is exactly what this node is here to soften.

How it works

The node ships two backends, and the choice matters:

  • pytorch (default) - loads the model weights (model_v0.9.pth), a 13k-tag map, and char_ip_map.json from the official gated PixAI repo. In code it builds the model as a timm WD14-EVA02-large encoder with a fresh linear head, then loads the PixAI weights on top. Supports FP16 on CUDA. The catch: the repo is gated - you need a HuggingFace token.
  • onnx - pulls model.onnx plus a CSV (with an extra ips column) from deepghs/pixai-tagger-v0.9-onnx, an ungated mirror. No auth, no token, same tagger, and it gets real batching through onnxruntime like the WD14 node.

Either way, images get resized to 448px and normalized, logits go through a sigmoid, and outputs are assembled in a deliberate order: character tags first, then the IP/series tags pulled from the character lookups, then general tags. That ordering is a small thing that makes the captions read well.

The inputs that matter

  • backend - pytorch or onnx. If you don't already have access to the gated repo, don't fight it; set onnx and move on. The README's own advice, and it's right.
  • include_ip - on by default; this is the series-tagging feature. Turn it off if you want plain character+general output.
  • hf_token - paste a token here, or export HF_TOKEN before launching ComfyUI; only needed for the pytorch backend.
  • device / fp16 - auto picks CUDA when available, and FP16 (default on) only actually engages on CUDA, so CPU users can ignore both.
  • threshold / character_threshold - 0.3 general / 0.85 character, same philosophy as the WD14 node: characters stay strict, general tags run looser.

batch_size, exclude_tags, separator, replace_underscore, trailing_comma and force_download behave like the rest of the pack, and both pytorch_repo_id / onnx_repo_id are editable if you want a mirror or a newer release.

Output

A single tags output - a list of strings, one caption per image in the batch - that wires into prompt/conditioning nodes or a caption writer the same way the WD14 and Camie nodes in this pack do.

Installing it

Identical to the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/adbrasi/booru-helper-mini
cd booru-helper-mini
pip install -r requirements.txt

Restart, and the PixAI node shows up alongside the other two. The PyTorch backend needs timm (it's in requirements.txt); if you skipped that and get a "requires torch and timm" error, that's the reason. Models download into models/pixai/ on first use.

Where people get burned

The gating is the whole trap. If the pytorch backend throws a 401-style auth error, you either forgot the token or you don't have access to the repo - and the fix is one dropdown away: flip backend to onnx, no token needed. Otherwise treat it like any young model: it's newer and thinner in community bake-time than WD14, so run it on your own images before committing a whole dataset to it. The pack itself is early days too, but the PixAI model it wraps is the reason to be here - that series-tagging behavior isn't something you can fake with the standard taggers.

Categorybooru-helper-mini

Inputs (16)

NameTypeDefaultDescription
imageIMAGE
backendCOMBOpytorch2 options: pytorch, onnx
batch_sizeINT41–256
thresholdFLOAT0.300–1
character_thresholdFLOAT0.850–1
separatorSTRING,
exclude_tagsSTRING
include_ipBOOLEANtrue
replace_underscoreBOOLEANfalse
trailing_commaBOOLEANfalse
force_downloadBOOLEANfalse
deviceCOMBOauto3 options: auto, cuda, cpu
fp16BOOLEANtrue
pytorch_repo_idSTRINGpixai-labs/pixai-tagger-v0.9
onnx_repo_idSTRINGdeepghs/pixai-tagger-v0.9-onnx
hf_tokenSTRING

Outputs (1)

NameTypeDescription
tagsSTRING