GALIAIS-Nodes Positive Prompt AI Enricher
Hand Your Tag Prompt to an LLM — and Keep It From Wandering
- AI服务商
- DB
- 增强正面提示词
- 自然语言补充
- 分析JSON
- 原始响应JSON
Sometimes you have the bones of a prompt and you want someone to flesh it out. That's the Positive Prompt AI Enricher: it takes your tag-based positive prompt, runs it through an LLM, and returns an enriched version plus the natural-language supplement the model wrote - with controls for how much it's allowed to add and where it goes.
The catch, and it's the honest one: this is the node in the pack that genuinely needs an AI provider. No AI服务商 wired in, no output. It's OpenAI-compatible, so the provider is whatever /v1-style endpoint you point it at - OpenAI, OpenRouter, or a local Ollama/LM Studio.
How it works
You feed it AI服务商 (the provider object, from the pack's AI Provider or Project Config node) and 正面提示词 (positive prompt). Then the knobs:
- 扩写模式 (expansion mode) - five modes, and they matter a lot: 自然语言补充 (natural-language supplement), Anima-complete-natural-language, Anima training caption, 场景导演描述 (scene director), and Tag-constrained full expansion. The Anima modes write in that model family's caption style; the scene-director mode frames it as scene direction. Pick per target model.
- 合并模式 (merge mode) - 追加到末尾 (append), 前置自然语言 (prepend natural language), 仅自然语言 (natural language only), or 仅分析不合并 (analyze only, don't merge).
- 上下文说明 (context) - free text so the LLM knows what it's expanding.
- 输出语言 (Chinese / English / mixed), 细节强度 (refined / standard / detailed), 最少句数 / 最多句数 (min/max sentences) - the sentence range is your leash on how chatty the LLM gets.
- 启用冲突剔除 with a 冲突剔除策略 - deterministic conflict pruning runs before the LLM, so the model doesn't inherit contradictions.
- 失败时返回原文 - off by default; if the API call fails, you get the original prompt back unaltered. (The orchestrator's default is on, worth noting.)
Outputs: 增强正面提示词 (the merged final prompt), 自然语言补充 (the supplement on its own), 分析JSON, and 原始响应JSON (the raw LLM response - the debugging output when the enrichment looks off).
Installing it
It ships in the GALIAIS-Nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/GALIAIS/GALIAIS-Nodes.git
Restart ComfyUI, or install via ComfyUI Manager ("GALIAIS-Nodes"). No Python dependencies, but you do need an OpenAI-compatible endpoint and a key - supply the key as plain text or via env:VAR_NAME / $VAR_NAME syntax. Field labels are Chinese, as throughout the pack.
The honest caveats
Two failure modes, both well documented in the ecosystem. First, subject drift: an enhancer with free rein adds detail you never asked for - which is why the sentence range, the mode choice, and the pre-LLM conflict pruning exist. Keep the leash short (fewer sentences, natural-language-supplement mode) and the drift stays small. Second, dirty output: a chat LLM loves emitting "Here is your enhanced prompt:" preamble. This node parses the response rather than blindly concatenating, but 原始响应JSON is where you check when something odd lands in your prompt. And remember responses are cached (see DB Cache Control) - if your enrichment looks frozen, clear the cache before blaming the model.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| AI服务商 | GALIAIS_NODES_AI_PROVIDER | — | |
| 正面提示词 | STRING | — | |
| 上下文说明 | STRING | — | |
| 输出语言 | COMBO | 中文 | 3 options: 中文, 英文, 中英混合 |
| 合并模式 | COMBO | 追加到末尾 | 4 options: 追加到末尾, 前置自然语言, 仅自然语言, 仅分析不合并 |
| 细节强度 | COMBO | 标准 | 3 options: 精炼, 标准, 详细 |
| 去重 | BOOLEAN | true | — |
| 失败时返回原文 | BOOLEAN | false | — |
| 随机种子 | INT | 00–4294967295 | — |
| 启用冲突剔除 | BOOLEAN | false | — |
| 冲突剔除策略 | COMBO | 自动 | 3 options: 自动, 保留前者, 保留后者 |
| 允许NSFW | BOOLEAN | false | — |
| 扩写模式 | COMBO | 自然语言补充 | 5 options: 自然语言补充, Anima完整自然语言, Anima训练标注Caption, 场景导演描述, Tag约束全面扩写 |
| 最少句数 | INT | 21–8 | — |
| 最多句数 | INT | 41–12 | — |
| DBopt | GALIAIS_NODES_DANBOORU_DB | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| 增强正面提示词 | STRING | — |
| 自然语言补充 | STRING | — |
| 分析JSON | STRING | — |
| 原始响应JSON | STRING | — |