GALIAIS-Nodes Prompt Template
Fill-in-the-blank prompts without a regex in sight
- DB
- 正面提示词
- 负面提示词
- 元信息JSON
The Prompt Template is the node that ties this pack's whole slot philosophy together. You define a prompt skeleton with {{placeholder}} holes in it, fill the holes with dedicated inputs, and it renders the finished positive and negative prompts. It's the boring-but-powerful middle of the GALIAIS flow: one template, many fillings.
The two ways to get a template
模板来源 switches between "手写" (handwritten) and "词典模板ID" (dictionary template ID).
- Handwritten is what you'll start with. Type your skeleton into
正面模板(positive) and负面模板(negative), using{{质量}},{{主体}},{{角色}}and friends as the holes. The 13 optional slot inputs - quality, subject, character, appearance, outfit, pose, expression, camera, scene, lighting, style, detail, natural language - are what get substituted in. Each one isforceInput, so you can wire them from other nodes instead of typing. - Dictionary template ID pulls a stored template out of the Danbooru DB by ID or name (the DB's
prompt_templatestable). You need a real DB path for this mode, and the downloaded template's positive/negative text becomes the skeleton. Everything else works the same.
The slot substitution is pleasantly forgiving: {{quality.style}} falls back to the plain {{风格}} slot if the dotted path isn't filled, so a slightly-misnamed placeholder degrades gracefully instead of crashing or spitting a literal {{...}} at the sampler.
What comes out
正面提示词 and 负面提示词 are your strings, plus 元信息JSON records which template and slots were used. One genuine gotcha: the positive output runs through the pack's Anima-flavored joiner, which strips quality tags (masterpiece, best quality, score_9) and any @artist token by default. If you're targeting a Pony or Illustrious checkpoint that wants score_9 in the positive, this node will quietly delete it. Plan your template accordingly - put quality tags in the negative side or accept the Anima cleaning.
Where it fits
Templates are how you keep a consistent structure across a whole batch. Lock the skeleton, vary the slots (feed 场景 from a random pool or a DB selector), and every generation shares the same anatomy while the details rotate. It's the reusable layer the one-shot Typed Composer V2 doesn't give you.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/GALIAIS/GALIAIS-Nodes.git
Restart ComfyUI. No dependencies. Dictionary-template mode needs the Danbooru runtime DB loaded (build it with Danbooru Runtime DB Builder, load it with the DB Loader), but handwritten mode runs with no DB at all. And yes - the slot inputs are labeled in Chinese (主体 is "subject", 场景 is "scene"). The tooltips help, but you'll memorize them in one session.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| 模板来源 | COMBO | 手写 | 2 options: 手写, 词典模板ID |
| DB路径 | STRING | — | |
| 模板ID或名称 | STRING | — | |
| 正面模板 | STRING | — | |
| 负面模板 | STRING | — | |
| 质量opt | STRING | — | |
| 主体opt | STRING | — | |
| 角色opt | STRING | — | |
| 外观opt | STRING | — | |
| 服装opt | STRING | — | |
| 姿势opt | STRING | — | |
| 表情opt | STRING | — | |
| 镜头opt | STRING | — | |
| 场景opt | STRING | — | |
| 光照opt | STRING | — | |
| 风格opt | STRING | — | |
| 细节opt | STRING | — | |
| 自然语言opt | STRING | — | |
| 负面opt | STRING | — | |
| DBopt | GALIAIS_NODES_DANBOORU_DB | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 正面提示词 | STRING | — |
| 负面提示词 | STRING | — |
| 元信息JSON | STRING | — |