ComfyUI Node

Booru Tag Lookup

Interrogate one tag before you trust it in a prompt

By hlibr·Created 5 months ago·Updated 5 months ago· 0
Booru Tag Lookup
    • candidate_resolution
    • incoming_aliases
    • outgoing_implications
    • debug_log
    tag_query
    include_retired_aliasestrue
    include_deleted_aliasesfalse
    prefer_underscoresfalse

    Booru Tag Lookup is the debug companion to the pack's main node. Where Booru Tag Pipeline chews through a whole prompt string and normalizes it, this one takes a single tag and dumps everything the local Danbooru snapshot knows about it. It's a small node and it's honest about being one - a focused utility, not a headline feature. That's exactly why it's useful.

    Why would you reach for it? Two reasons. First, before you build a workflow around a tag you're not sure about: you want to prompt an Illustrious or NoobAI checkpoint with twintails, but you've also seen twin tails floating around, and you want to know which one the model actually trained on. This node tells you, straight from the canonical tag table. Second, troubleshooting: the pipeline flagged something as unknown or replaced it in a way you didn't expect, and you want to see the alias and implication graph behind the decision instead of guessing.

    How it works

    It shares the entire data layer with the pipeline - the same local SQLite snapshot (baton4ik/danbooru-tag-metadata-snapshot, roughly 1.7M tags, 59k aliases, 49k implications) downloaded on first use. There are no separate dependencies and no model weights; this is pure table lookups.

    One input: tag_query. Paste twin tails or 1girl and run. The three optional toggles - include_retired_aliases, include_deleted_aliases, prefer_underscores - mirror the pipeline's, so a lookup shows you the same alias universe the pipeline would have resolved against.

    The outputs are the interesting part:

    • candidate_resolution - the canonical form the tag resolves to (or empty if it's unknown).
    • incoming_aliases - every alias that points at the canonical tag, one per line with its status (active, retired, deleted). This is gold for understanding why your prompt kept getting rewritten.
    • outgoing_implications - what the canonical tag implies. See that 1girl implies solo and female? That's why the pipeline's implication expansion behaves the way it does.
    • debug_log - the resolution summary, including a blunt UNKNOWN when the snapshot has nothing for your query.

    One thing it deliberately does not do: it won't drop quality boilerplate or expand implications for you. That's the pipeline's job. This node reports the raw relationships and lets you draw the conclusions.

    Installing it

    You don't install this separately - it ships in the same pack as the pipeline:

    cd /path/to/ComfyUI/custom_nodes
    git clone https://github.com/hlibr/ComfyUI-Booru-Tag-Pipeline.git comfyui_booru_tag_pipeline
    /path/to/ComfyUI/.venv/bin/python -m pip install -r comfyui_booru_tag_pipeline/requirements.txt
    

    Restart ComfyUI and both nodes appear under prompt > Booru Tags. It's also in ComfyUI Manager if you search the pack by name. If you already installed the pipeline, this node is already sitting in your node list - you just haven't met it yet.

    The only gotcha worth naming: the snapshot download is ~175MB and happens on first use of either node, so the first lookup can stall for a few seconds while Hugging Face warms up. After that it's local, read-only, and fast. For a tool whose whole job is "check before you commit," that's a fair trade.

    Categoryprompt/Booru Tags

    Inputs (4)

    NameTypeDefaultDescription
    tag_querySTRING
    include_retired_aliasesoptBOOLEANtrue
    include_deleted_aliasesoptBOOLEANfalse
    prefer_underscoresoptBOOLEANfalse

    Outputs (4)

    NameTypeDescription
    candidate_resolutionSTRING
    incoming_aliasesSTRING
    outgoing_implicationsSTRING
    debug_logSTRING