DOGMA Tile-Specific Restoration Prompt v25
Turning a chatty VLM tile report into a prompt that can't invent anything
- prompt
- clean_report
Vision-language models are confidently wrong in a specific way: ask one what it sees in a 3K crop and it will describe the tree that isn't there, the person who's actually a bollard, the sign it read as words that don't exist. Then someone hands that text to an editor model as a prompt and the hallucination becomes pixels. This node is the guardrail between the two.
What it does
Nothing generative. It cleans the VLM's output - strips markdown fences, collapses whitespace, and hard-truncates at 1100 characters on a word boundary - and then wraps it in a fixed instruction block that frames the report as evidence, not instruction:
- "The source tile is ground truth. Do not redesign, repopulate or reinterpret the scene."
- "Do not introduce ANY semantic object that is not directly supported by the source tile."
- Ambiguity must survive as ambiguity: blur, haze, glass reflections, clipped highlights and indistinct distant shapes are explicitly not permission to invent.
- Text is frozen: existing lettering keeps its glyph structure, never inferred or rewritten.
- The whole geometry list - count, position, silhouette, lighting direction, exposure, colour, edge continuity with neighbouring tiles.
project_context gets its own framing line: a style/era constraint only, never evidence that an object exists. That sentence is the difference between "1970s Milan" as an adjective and "1970s Milan" as an invitation to add a Fiat.
If the report comes in empty, it substitutes a conservative stub that tells the model to preserve everything uncertain and invent nothing. No crash, no promptless sample.
Inputs and outputs
Two required inputs, both multiline strings: tile_report (from your VLM node) and project_context. Outputs prompt - go straight into your positive conditioning - and clean_report, the truncated report with the fences gone. Pipe clean_report into a text preview when you want to see what the VLM actually said before the wrapper.
The 1100-character ceiling is a deliberate design choice by the author, and it's visible in the comment: a verbose VLM response must not become a creative mega-prompt.
Install
ComfyUI Manager → search DOGMA Nodes, or:
cd ComfyUI/custom_nodes && git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
Restart. Zero dependencies - requirements.txt says # No external dependencies. - and this node is pure Python string work, so it costs nothing to run. The pack's README doesn't document it or its siblings; the semantic detailer suite registers from dogma_semantic_v5641.py on import.
Why a wall of text works here
Normally "long prompt" is a smell. It isn't on this model: Klein's text encoder is a Qwen3 LLM and your prompt goes in through a chat template, so instructions and constraints are read as language rather than as a pile of tags. The KB's Flux 2 doc has the community version of the same insight for edits - prompt the action, name what must not change. V25 is that principle, written out at length and applied per tile.
Where it bites
The VLM's weakness is structural, not fixable by prompt. Every captioner covered in the KB's LLM doc shares one failure: multi-subject attribution. Two people and the VLM mixes up who wears what. A guardrail prompt reduces how much damage that does - it can't stop the report from being wrong, so it explicitly tells the model not to resolve uncertain shapes into named objects. That's mitigation, and it's honest about being mitigation.
Truncation is silent. A report that runs long loses its tail, and if your VLM puts the useful part last you've thrown it away. clean_report is how you find out.
Don't stack this with another prompt enhancer. The output is already an instruction-dense paragraph; run it through an LLM rewriter and you hand the creative licence straight back.
This is the verbose member of the family. The same pack ships shorter, field-parsed composers (v34, v36, v39, v42, v44) that pull structured lines out of the report instead of pasting it. If V25 reads like too much prompt for your model, one of those is the fix - they're the same job with a tighter extraction policy.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| tile_report | STRING | — | |
| project_context | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| clean_report | STRING | — |