Nodes/comfyui-pixai-v0.9-tagger/PixAI Tagger From Path/URL
ComfyUI Node

PixAI Tagger From Path/URL

Tag any image from a file path or URL without dragging it into your graph

By vjumpkung·Created 4 months ago·Updated 17 days ago· 1
PixAI Tagger From Path/URL
    • tags
    • general_tags
    • character_tags
    • ips
    • general_json
    • character_json
    • ips_mapping_json
    image_path_or_url
    model_namev0.9
    threshold_modemodel default
    general_threshold0.35
    character_threshold0.50
    max_general_tags0
    max_character_tags0
    tag_separator,
    replace_underscoresfalse
    include_scoresfalse
    character_firsttrue

    If you train anime LoRAs or just like poking at what a checkpoint "thinks" an image is, you've probably got a WD14 tagger parked in your graph. This node is the PixAI tagger - a newer, hungrier rival to WD14 - with one twist: instead of feeding it a ComfyUI IMAGE tensor, you hand it a file path or a URL and it tags that. No loading node, no image in the graph, no intermediate save. Paste in D:/images/sample.webp or https://..., hit run, and out comes a prompt-ready Danbooru-tag string.

    Why bother when WD14 already works? The PixAI v0.9 model behind this (pixai-labs/pixai-tagger-v0.9) was trained on much more recent booru data than the aging WD14 corpus, so it knows tags and characters that WD14 flat-out doesn't - community chatter pegs it as noticeably better at newer material, and it goes further than plain taggers by separating character tags from which series they belong to. That's the ips output: detected IPs like genshin_impact. If you're building a dataset and want to sort crops by franchise, that alone beats gluing WD14 output together by hand.

    How it works

    This is a thin, honest wrapper. Both nodes in the pack call imgutils.tagging.get_pixai_tags from dghs-imgutils; PixAITaggerFromPath just passes your path or URL string straight through, and imgutils handles fetching and decoding. The name says "PixAI" and people assume an API - there isn't one, and there's no key. The v0.9 model runs locally as an ONNX model that downloads from Hugging Face on first use, so the first tag on a fresh install takes a while and costs you roughly a gigabyte of disk. The model itself was released as a .pth, and imgutils ships an ONNX conversion, which is why this whole thing works inside ComfyUI's Python without a GPU-heavy stack.

    Outputs come back as plain STRINGs: tags (character and general combined), general_tags, character_tags, and ips - plus general_json, character_json, and ips_mapping_json if you want the confidence scores and the character-to-series mapping in structured form. Wire tags into a CLIP Text Encode for caption round-tripping, or save it next to an image while building training data.

    Inputs worth touching

    • image_path_or_url - the whole point. Local path or URL; leave it empty and the node throws on purpose.
    • model_name - defaults to v0.9; the tooltip says it accepts any Hugging Face repo ID, so you can swap tagger versions without a code change.
    • threshold_mode - keep it on model default and trust imgutils' built-in thresholds. Flip to custom only when you're chasing false positives, then general_threshold / character_threshold (defaults 0.35 / 0.5) take over.
    • max_general_tags / max_character_tags - 0 means "keep everything the model returns," which is the sane default for training. Set them positive only to slim output down.
    • character_first (default on) puts character tags ahead of general ones in tags; replace_underscores swaps _ for spaces, include_scores appends confidence like tag:0.912.

    Install

    Easiest is ComfyUI Manager: search comfyui-pixai-v0.9-tagger, install, restart. Manager runs the pack's install.py, which matters - see the gotcha. Manual install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/vjumpkung/comfyui-pixai-v0.9-tagger
    cd comfyui-pixai-v0.9-tagger
    python install.py
    

    The gotcha that burns people

    dghs-imgutils pins numpy<2 in its package metadata, and if pip honors that it downgrades ComfyUI's numpy - a classic way to brick an otherwise-fine install. That's why install.py installs imgutils with --no-deps and lists only the deps the PixAI code path actually needs in requirements.txt. So: never pip install dghs-imgutils bare in your ComfyUI environment, and don't skip install.py. Manual equivalent, if you insist:

    pip install -r requirements.txt
    pip install --no-deps "dghs-imgutils>=0.19.0"
    

    Other real-world friction: the first run downloads the model and looks hung - it isn't, give it a minute. URLs behind hotlink protection or requiring auth will fail; for those, download the file and tag the local path instead. And if you have an image that's already in your graph as a tensor, the pack's sibling PixAITagger node is the better pick - this one shines for files on disk and direct URL drops. It's early days for this pack (barely starred), but the wrapper is small and the underlying model is the interesting part.

    Categoryimage/tagging

    Inputs (11)

    NameTypeDefaultDescription
    image_path_or_urlSTRING
    model_nameSTRINGv0.9PixAI model name or Hugging Face repository ID.
    threshold_modeCOMBOmodel default2 options: model default, custom
    general_thresholdFLOAT0.350–1Used only when threshold_mode is custom.
    character_thresholdFLOAT0.500–1Used only when threshold_mode is custom.
    max_general_tagsINT00–40960 keeps every general tag returned by the model.
    max_character_tagsINT00–10240 keeps every character tag returned by the model.
    tag_separatorSTRING, Separator for string outputs. Supports escaped \n and \t.
    replace_underscoresBOOLEANfalse
    include_scoresBOOLEANfalse
    character_firstBOOLEANtrue

    Outputs (7)

    NameTypeDescription
    tagsSTRING
    general_tagsSTRING
    character_tagsSTRING
    ipsSTRING
    general_jsonSTRING
    character_jsonSTRING
    ips_mapping_jsonSTRING