Scene Validator
The quality gate between the LLM and your prompt
- scene
- config
- scene
- warnings
- errors
- raw
The Scene Validator is the boring middle child of the Scene Compiler pack, and that's a compliment. Its job is to take the Scene JSON the Analyzer produced, check it against the compiler's schema, and make sure only well-formed data reaches the Resolver. The Analyzer is the exciting LLM stage; this node is the quality gate that keeps the LLM's occasional nonsense from wrecking your prompt.
The setup for why this matters: the Analyzer returns structured data, not tags - a JSON description of characters, interactions, environment, and so on. The Resolver then compiles that into a prompt. If the Analyzer occasionally hands back a scene with fields in the wrong shape, or fields the compiler doesn't know, you want that caught somewhere with a clear message - not silently half-translated later. This is that somewhere.
How it works
The Validator runs the scene through the schema layer and normalizes it, then passes it through with warnings and errors attached. It's genuinely thin - it contains no compiler logic, just validation - and the pack's single runtime dependency (jsonschema) exists precisely for this. There's one behavior toggle worth knowing about: validator_allow_unknown_fields, which defaults to off. Off means unexpected fields in the scene data are flagged rather than kept, which is what you want almost always - it's how the pack makes sure a malformed concept doesn't silently ride along into your prompt. Turn it on only if you're deliberately carrying extra fields for your own purposes.
Inputs and outputs
Only one required input:
- scene (SCENE) - the scene data from the Scene Analyzer. Wire Analyzer's
sceneoutput here.
config is optional; it's how validator_allow_unknown_fields gets set, so connect the Configuration node if you need that control.
Outputs are a pass-through plus diagnostics:
- scene (SCENE) - the checked, normalized scene. Wire into the Resolver.
- warnings / errors (STRING) - where validation problems are reported. The difference matters: warnings are recoverable (a near-miss), errors mean something failed.
- raw (STRING) - the scene serialized back to JSON, handy for a quick eyeball.
Installing and the gotchas
cd ComfyUI/custom_nodes
git clone https://github.com/kunail0804/ComfyUI-Scene-Compiler.git
Restart ComfyUI. The Validator runs fully offline - no Ollama, no model downloads - so if the pack is installed at all, this node just works. (Python 3.11+ is the one hard requirement, and the only installed dependency is jsonschema.)
The thing people trip on: the validator doesn't invent or repair - it reports. If you see a stream of warnings here, don't fight the node; fix the input, which usually means the Analyzer's understanding of your sentence, or a concept that isn't in the Knowledge Base. And if you're debugging a pipeline where the Resolver gets nothing, the Validator's errors output is the first place to look - a problem caught here is one that would otherwise surface as a mysteriously empty prompt a stage later.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| scene | SCENE | The scene data from the Scene Analyzer. | |
| configopt | COMPILER_CONFIG | Optional: connect a Configuration node. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| scene | SCENE | — |
| warnings | STRING | — |
| errors | STRING | — |
| raw | STRING | — |