Nodes/GALIAIS-Nodes/GALIAIS-Nodes Danbooru Query Select
ComfyUI Node

GALIAIS-Nodes Danbooru Query Select

Look Up Danbooru Tags in Chinese or English

By GALIAIS·Created 3 months ago·Updated 3 months ago· 0
GALIAIS-Nodes Danbooru Query Select
  • DB
  • 英文Tag
  • 中文Label
  • 选中项
  • 候选JSON
  • 候选数量
查询
DB路径
查询语言中英文
匹配模式smart
候选序号第1项
允许NSFWfalse
最低热度0
候选数量20

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, or contains. smart is the default and the one you'll usually want; exact for 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.

CategoryGALIAIS-Nodes/prompt

Inputs (9)

NameTypeDefaultDescription
查询STRING
DB路径STRING
查询语言COMBO中英文3 options: 中英文, 中文, 英文
匹配模式COMBOsmart4 options: smart, exact, prefix, contains
候选序号COMBO第1项20 options: 第1项, 第2项, 第3项, 第4项, 第5项, 第6项, +14
允许NSFWBOOLEANfalse
最低热度INT00–100000000
候选数量INT201–20
DBoptGALIAIS_NODES_DANBOORU_DB

Outputs (5)

NameTypeDescription
英文TagSTRING
中文LabelSTRING
选中项STRING
候选JSONSTRING
候选数量INT