GALIAIS-Nodes Danbooru Query Select
Look Up Danbooru Tags in Chinese or English
- DB
- 英文Tag
- 中文Label
- 选中项
- 候选JSON
- 候选数量
You know what you want in the image. You do not know the exact Danbooru tag spelling for it, and getting it wrong means the model ignores you. Danbooru Query Select is the node that fixes that: type something loose - in Chinese or English - and it searches the dictionary and hands you the canonical tag.
This is one of the friendliest nodes in the GALIAIS-Nodes pack, because it's the one that doesn't assume you already speak fluent booru. The whole point is lookup, not memory.
How it works
You type a 查询 (query) like 长发 or long hair or blonde. The node searches the loaded dictionary and returns up to 候选数量 (candidate count, max 20) matches, each a proper Danbooru tag with its Chinese label. Then you pick which slot you meant via the 候选序号 dropdown - literally "第1项" (item 1) through "第20项". That dropdown is the interface: the search fills it, you choose, the output reflects your choice.
The settings that shape results:
- 查询语言 - 中英文 (Chinese+English), 中文, or 英文. If you're typing Chinese, say so.
- 匹配模式 -
smart,exact,prefix, orcontains.smartis the default and the one you'll usually want;exactfor when you already know the tag and just want confirmation. - 最低热度 (min heat) - a floor on the tag's post count. Set this above 0 and you filter out obscure tags that the model never learned well anyway. The KB's advice is exactly this: on Danbooru-trained models, a character or artist with a few hundred works usually resolves from its name alone - low-count tags are noise.
- 允许NSFW - off by default; flip it if you're deliberately working with the explicit end of the board.
Outputs: 英文Tag and 中文Label (the canonical pair, ready to drop into a prompt), 选中项 (a formatted option string), 候选JSON (all candidates, for inspection), and 候选数量. For a beginner, wire 英文Tag into your prompt composer and ignore the rest.
Installing it
It's one node in the GALIAIS-Nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/GALIAIS/GALIAIS-Nodes.git
Restart ComfyUI, or grab the pack from ComfyUI Manager ("GALIAIS-Nodes"). No Python dependencies. The one requirement is a loaded dictionary - the node takes a DB路径 or an optional wired-in DB from the Danbooru DB Loader. Without a DB you get zero candidates and a quiet none, which is the most common "why is it empty" moment.
Notes
A couple of quirks. First, the pack is Chinese-first: field labels like 候选序号 and 最低热度 are the actual UI. Second, remember this node returns a single selection - it's for when you need one good tag. If you want to resolve a whole messy tag list at once, that's what the Danbooru Tag Resolver is for. And if you're repeatedly picking from a fixed category of tags, the Taxonomy Select node is the more targeted tool. Query Select is the general-purpose search box, and it's the right first place to go when you're stuck on vocabulary.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| 查询 | STRING | — | |
| DB路径 | STRING | — | |
| 查询语言 | COMBO | 中英文 | 3 options: 中英文, 中文, 英文 |
| 匹配模式 | COMBO | smart | 4 options: smart, exact, prefix, contains |
| 候选序号 | COMBO | 第1项 | 20 options: 第1项, 第2项, 第3项, 第4项, 第5项, 第6项, +14 |
| 允许NSFW | BOOLEAN | false | — |
| 最低热度 | INT | 00–100000000 | — |
| 候选数量 | INT | 201–20 | — |
| DBopt | GALIAIS_NODES_DANBOORU_DB | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| 英文Tag | STRING | — |
| 中文Label | STRING | — |
| 选中项 | STRING | — |
| 候选JSON | STRING | — |
| 候选数量 | INT | — |