Configuration
One node to rule them all (and load the knowledge base)
- config
- knowledge_base
- warnings
- errors
The Configuration node is where the pack's settings live, and it's also your Knowledge Base loader - two jobs folded into one node in version 2.1 because asking users to wire a separate loader node was silly when the Knowledge Base ships inside the package. You drop this node down, and it does two things: it collects every compiler setting you'd ever want to touch into a single config connection, and it reads the ~1.8 MB Danbooru-derived Knowledge Base that ships with the pack and emits it on knowledge_base. From there you wire both into the pipeline.
It's the node that makes the rest of the pack usable. The Analyzer, Validator, and Resolver each take an optional config input - plug the same Configuration output into all three, and you can change behavior from one place instead of editing a dozen widgets. In earlier versions of this pack the analyzer model was set in two disconnected places; v2 fixed that by centralizing everything here. That's the honest version of "fewer nodes, more sense."
The inputs that actually matter
There are a lot of widgets on this node. Beginners should care about roughly five:
- analyzer_model - which local Ollama model reads your description. Default is
llama3; set it to whatever you've actually pulled. - analyzer_temperature - default 0, which means "most consistent." This is a determinism-first pack; leave it at 0 unless you have a reason not to.
- resolver_include_nsfw - off by default, which keeps results safe-for-work. If you're doing explicit stuff, this is the switch.
- semantic_enabled - the opt-in "closest known tag" fallback for concepts that miss an exact Knowledge Base lookup. Off by default, and it can only return tags that already exist in the Knowledge Base, so it never invents anything.
- knowledge_base_reload - a counter. Bump it after you edit the Knowledge Base (via the optional browser editor at
http://127.0.0.1:8188/scene-compiler/kb) to force a fresh read. The Knowledge Base is cached process-wide so it only loads once, and this is how you tell it "load again."
The rest - retries, timeout, alias mapping, expansion depth, debug level - are sensible defaults you'll mostly leave alone, and each has a tooltip written in plain English if you're curious.
Outputs
- config (COMPILER_CONFIG) - wire into the Analyzer, Validator, and Resolver.
- knowledge_base (KNOWLEDGE_BASE) - wire into the Resolver. This is the only thing that feeds the Resolver's tag lookup.
- warnings / errors (STRING) - mostly here so a KB load failure is visible instead of silent.
Installing and the gotchas
cd ComfyUI/custom_nodes
git clone https://github.com/kunail0804/ComfyUI-Scene-Compiler.git
Then restart ComfyUI. The pack's runtime dependency list is remarkably small - just jsonschema>=4.18, on Python 3.11+ - and the Knowledge Base is already in the repo, so there are no heavy model downloads to chase. The only external piece is Ollama for the analyzer stage.
The trap most people hit: they edit the Knowledge Base, see no change, and assume it's broken. It's not - the load-once cache is doing its job. Bump knowledge_base_reload. The other recurring gotcha is forgetting the analyzer runs whatever model is in this node, so if you renamed your Ollama model, the defaults here (llama3) won't match what you pulled.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| analyzer_model | STRING | llama3 | Which local Ollama model reads your description (e.g. llama3). |
| analyzer_temperature | FLOAT | 0.00–2 | How freely the model interprets. 0 = most consistent. |
| analyzer_max_retries | INT | 30–10 | How many times to retry if the model returns a bad answer. |
| analyzer_timeout | INT | 3001–3600 | How long to wait for the model, in seconds. The default is generous so the first run (while the model loads) doesn't time out. |
| resolver_strict_mode | BOOLEAN | true | Report concepts not in the Knowledge Base instead of guessing. |
| resolver_allow_aliases | BOOLEAN | true | Map synonyms to the same tag (e.g. 'girl' = 'female'). |
| resolver_expansion_enabled | BOOLEAN | true | Automatically add related tags (e.g. an outfit's parts). |
| resolver_max_expansion_depth | INT | 81–32 | How far related tags are followed. Higher adds more tags. |
| resolver_include_nsfw | BOOLEAN | false | Allow explicit (NSFW) tags. Off keeps results safe-for-work. |
| validator_allow_unknown_fields | BOOLEAN | false | Keep unexpected fields in the scene data. Usually leave off. |
| prompt_remove_duplicate_tags | BOOLEAN | true | Remove repeated tags from the final prompt. Recommended on. |
| debug_enabled | BOOLEAN | false | Turn on extra logging to troubleshoot. |
| debug_level | COMBO | basic | How much detail the logs include. |
| resolver_knowledge_base_versionopt | STRING | Advanced: pin a Knowledge Base version. Empty = default. | |
| semantic_enabledopt | BOOLEAN | false | Find the closest known tag when a concept isn't recognized. Off by default; it never invents tags. |
| semantic_min_similarityopt | FLOAT | 0.500–1 | How close a match must be for the closest-tag search. |
| semantic_backendopt | STRING | char_ngram | Advanced: which method the closest-tag search uses. |
| knowledge_base_reloadopt | INT | 0 | Bump this if you edited the Knowledge Base, to reload it. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| config | COMPILER_CONFIG | — |
| knowledge_base | KNOWLEDGE_BASE | — |
| warnings | STRING | — |
| errors | STRING | — |