Nodes/GALIAIS-Nodes/GALIAIS-Nodes Danbooru Tag Resolver
ComfyUI Node

GALIAIS-Nodes Danbooru Tag Resolver

Resolve Any Messy Text Into Proper Danbooru Tags

By GALIAIS·Created 3 months ago·Updated 3 months ago· 0
GALIAIS-Nodes Danbooru Tag Resolver
  • DB
  • 英文Tags
  • 中文Labels
  • 解析JSON
  • 数量
词条
DB路径
匹配模式exact
保留未匹配true
允许NSFWfalse
最低热度0
统一权重1.00
画师加Attrue

Every anime prompt workflow eventually produces a pile of tags that came from four different sources - a WD14 caption dump, a character card, something you typed at 2am - and they don't agree on spelling, capitalization, or whether the underscore is there. The Danbooru Tag Resolver is the node that normalizes that mess: you paste in raw text, it resolves every token against the dictionary, and it hands you clean canonical tags plus their Chinese labels.

Where Query Select is for finding one tag you're unsure about, the Resolver is for processing a whole list at once. It's the "make my tag soup respectable" node.

How it works

You drop your text into 词条 (the field is multiline, so paste freely). The node splits it into tokens and resolves each one against the loaded dictionary using 匹配模式: exact (default - only exact matches resolve), prefix, or contains. The settings that matter:

  • 保留未匹配 (keep unresolved) - on by default. Tokens that don't resolve are kept in the output as-is rather than silently dropped. Turn it off and you get only verified tags.
  • 统一权重 (uniform weight) - a single weight applied to every resolved tag. Set 1.0 to leave things alone; bump to emphasize, drop to de-emphasize.
  • 画师加At (artist gets @) - on by default. Artist tags are rewritten as @artist. That matters on the anime SDXL lineage: artist names function as style tags, and the @ convention is how the pack keeps them distinguished from general tags in a prompt.
  • 最低热度 - a post-count floor; filtered tags drop out of the results.
  • 允许NSFW - off by default; the resolver won't return explicit tags until you flip it.

Outputs: 英文Tags (the clean, weighted, comma-joined tag string - this is what you wire into your prompt), 中文Labels (the same list in Chinese, handy as a human-readable reference), 解析JSON (per-token resolution records), and 数量 (how many terms resolved). For a beginner: 英文Tags goes to your composer, 中文Labels goes to a text viewer if you want to read what you actually have.

Installing it

It's part of the GALIAIS-Nodes pack:

cd ComfyUI/custom_nodes
git clone https://github.com/GALIAIS/GALIAIS-Nodes.git

Restart ComfyUI, or find "GALIAIS-Nodes" in ComfyUI Manager. No Python dependencies. It needs a dictionary - give it a DB路径 or wire in the DB output from the Danbooru DB Loader. As everywhere in this pack, the field labels are Chinese (词条, 保留未匹配, 画师加At, …).

Notes and gotchas

The one trap: exact matching is exact. 1girl resolves, 1 girl doesn't. If your input has sloppy spacing, switch to contains or pre-clean it, and decide whether 保留未匹配 should keep the junk in or filter it out - that toggle is your answer to "why did my prompt get longer instead of cleaner." Also, the resolver is normalization, not invention: it won't fix a tag that genuinely doesn't exist, it'll just leave it in (or drop it, if you disabled 保留未匹配) and tell you via 数量 how much actually resolved. Use that count as your signal: numbers are health.

CategoryGALIAIS-Nodes/prompt

Inputs (9)

NameTypeDefaultDescription
词条STRING
DB路径STRING
匹配模式COMBOexact3 options: exact, prefix, contains
保留未匹配BOOLEANtrue
允许NSFWBOOLEANfalse
最低热度INT00–100000000
统一权重FLOAT1.000–5
画师加AtBOOLEANtrue
DBoptGALIAIS_NODES_DANBOORU_DB

Outputs (4)

NameTypeDescription
英文TagsSTRING
中文LabelsSTRING
解析JSONSTRING
数量INT