Nodes/GALIAIS-Nodes/GALIAIS-Nodes Danbooru DB Loader
ComfyUI Node

GALIAIS-Nodes Danbooru DB Loader

The Node Everything Else Wires Into — Your Danbooru Tag Database, Loaded Once

By GALIAIS·Created 3 months ago·Updated 3 months ago· 0
GALIAIS-Nodes Danbooru DB Loader
  • Tag黑名单
  • DB
  • DB路径
  • 词典信息JSON
  • 总词条
  • 已翻译
  • 模板数
DB路径
语言zh-CN
启动时验证true

The Danbooru DB Loader is the front door of the whole GALIAIS-Nodes pack. Everything that knows a Danbooru tag - the tag resolvers, the query select, the character nodes, the style selector - wants its shared DB object, and this is the node that produces it. If you're building an anime prompt workflow with this pack, this sits near the top of your graph and you connect it once.

The reason it exists: the Danbooru tag database is not bundled with the pack. It's huge, and it lives in a separate repo (https://github.com/GALIAIS/Danbooru-Tag-Database). This loader's job is to point at that sqlite file, validate it, and hand out a single shared object - plus a few sanity numbers.

How it works

You give it a DB路径 (DB path) to your dictionary file. Behind the scenes it does something clever: it checks whether a compact "runtime DB" sibling (a .runtime.db file next to your full dictionary) exists, and if it does, it loads that instead - the full dictionary is slow to search, the runtime DB is built for it. The 启动时验证 (validate on startup) toggle, on by default, opens the DB and reads its stats so downstream nodes don't trip over a bad path.

The inputs that matter:

  • DB路径 - where your dictionary lives. Leave it empty and you get an empty, degraded DB; most of the pack silently does less without one.
  • Tag黑名单 (optional) - wire in a blacklist object and the loader bakes those tags in as a global filter for every node downstream.

Outputs, in order: DB (the object you wire into tag and character nodes), DB路径 (the resolved path - useful to confirm it picked up the runtime DB), 词典信息JSON, 总词条 (total entries), 已翻译 (how many have Chinese translations), and 模板数 (prompt templates in the dictionary). For a beginner, only the first one matters; the counts are diagnostics to prove the DB actually loaded.

Installing it

Install the pack, not the node:

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

Restart ComfyUI, or find "GALIAIS-Nodes" in ComfyUI Manager. The pack has zero Python dependencies. The thing you must obtain separately is the database file - grab it from the GALIAIS/Danbooru-Tag-Database repo. One heads-up: the whole pack is Chinese-first, so this node's labels read DB路径, 语言, 启动时验证. The 语言 (language) dropdown currently offers only zh-CN - one option, so don't go hunting for an English mode.

Common issues

The classic failure is a path that points nowhere: with 启动时验证 on, a missing file surfaces immediately as empty counts (总词条 0) instead of a confusing crash three nodes downstream. If your counts look wrong after updating the dictionary, the loader may be caching a stale runtime path - flip over to the DB Cache Control node and clear caches. And if you changed the dictionary file itself, rebuild the runtime DB (Runtime DB Builder) before reloading, or the loader keeps finding the old sibling.

CategoryGALIAIS-Nodes/prompt

Inputs (4)

NameTypeDefaultDescription
DB路径STRING
语言COMBOzh-CN1 options: zh-CN
启动时验证BOOLEANtrue
Tag黑名单optGALIAIS_NODES_TAG_BLACKLIST

Outputs (6)

NameTypeDescription
DBGALIAIS_NODES_DANBOORU_DB
DB路径STRING
词典信息JSONSTRING
总词条INT
已翻译INT
模板数INT