GALIAIS-Nodes DB Cache Control
Stale Tags? See Everything Cached and Wipe It in One Click
- 缓存JSON
- 缓存项数
Every serious node pack eventually grows an invisible cache layer, and when things go stale, you need a way to see it and nuke it. That's exactly what DB Cache Control is: a tiny config node that shows you what GALIAIS-Nodes has cached and lets you clear it all with one run.
You'll meet it the first time you update your Danbooru dictionary, rebuild a runtime DB, or change a blacklist and the pack keeps behaving like nothing changed. The cache is the culprit, and this node is the cure.
How it works
One dropdown, 操作 (operation): 查看 (view) or 清空 (clear).
- 查看 returns a JSON breakdown of every cache the pack maintains: the option cache (the per-field candidate lists the lazy selectors build), the tree cache (taxonomy trees), the runtime-path cache (the mapping from a dictionary to its
.runtime.dbsibling - the one that goes stale when you rebuild), the tag-existence cache, and the AI response cache (the pack caches LLM responses from the AI nodes, keyed by provider + message, with a 128-entry limit). - 清空 wipes all of them in one go, including the AI response cache, then reports the (now mostly zeroed) counts.
Outputs: 缓存JSON (the full breakdown - wire it to a text viewer if you want to see it) and 缓存项数 (the total count, which makes this node a handy "is anything cached?" indicator even when you're just looking).
The honest way to use it: keep it out of your main graph, and drop it in only when something smells stale. Set 操作 to 查看, see the numbers, and if a suspicious cache is present, switch to 清空 and re-run. Because the runtime-path cache is keyed on dictionary path and cached on first load, "I replaced the DB but the loader finds the old one" is the classic symptom - one 清空 run fixes it.
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 install the pack via ComfyUI Manager ("GALIAIS-Nodes"). No Python dependencies, no models. As with the whole pack, the labels are Chinese: 操作, 查看, 清空.
Notes
There's not much to get wrong with this node, which is the point. One thing worth knowing: clearing the AI response cache is included in 清空, so if you're iterating on a prompt and the AI node keeps returning the exact same enriched output, the cache - not the LLM - is probably what's making it feel stubborn. A clear restores fresh calls. It's a boring node, and in a pack with this much machinery, boring maintenance nodes earn their place.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| 操作 | COMBO | 查看 | 2 options: 查看, 清空 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 缓存JSON | STRING | — |
| 缓存项数 | INT | — |