DOGMA v38 Adaptive Category Prompt
The prompt that changes shape depending on what you're repairing
- prompt
- info
Two string inputs, two string outputs, and about thirty lines of Python. DOGMAAdaptiveCategoryPromptV38 is the smallest useful idea in the v38 generation of this pack: the wording of a repair prompt should depend on what kind of thing you're repairing, and the planner already told you which kind it is.
The three kinds
The kind input carries one of three values, and where it comes from is the v38 inventory format - a GROUP|category|sam_prompt|kind line per sector, so OBJECT, STRUCTURE, SURFACE travel with the category from the moment the planner writes it.
OBJECT - countable things you can't afford to duplicate. The prompt is the paranoid one: preserve exact count, identity, position, scale, orientation, silhouette, colour, pose and occlusion; improve coherent existing detail only; "do not add, remove, replace, redesign or modernize anything".
STRUCTURE - architecture. Identity, count, placement, proportions, perspective, colour, lighting, occlusion, and an explicit "improve existing structural edges and repetitive detail without redesigning anything", plus a line about preserving all text, logos and signs. Windows and railings are where a local pass goes wrong by tidying - it straightens a facade into something that isn't the building any more.
SURFACE - road, sky, water, grass. The loosest framing, because there's nothing to identify: preserve the footprint, boundaries, colour, lighting, wear, density and large-scale structure, and improve fine photographic texture "only where already supported". No new markings, no new plantings, no new semantic content.
Feed it category="none" (or an empty string, which normalises to the same) and you get "PRESERVE IMAGE." - the author's convention for an inactive slot. Wire that into a conditioning box and the pass is a no-op instead of a resample.
Where it slots in
This is not a standalone tool. It's the rung between an inventory planner and a crop/Klein branch: planner emits category + kind per group, you fan those out to one prompt composer per sector, the composed prompt goes to the text encoder feeding your per-crop masked inpaint, and the info output is a readable one-liner ("adaptive surface prompt: road") you can watch to confirm the sector is what you think it is. That info line is more useful than it sounds - the number one failure in these graphs is sectors silently doing nothing, and a prompt that says "inactive inventory slot" tells you immediately.
Install
Same pack, same trivial install:
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
Or install DOGMA Nodes through ComfyUI Manager, then restart. Zero Python dependencies (dependencies = [] in pyproject, a single "No external dependencies" comment in requirements.txt) - the models are your problem: a Qwen3-VL-class VLM for planning, a grounded SAM for masks, FLUX.2 Klein for the re-render. The v38 composers assume the v38 inventory format, so if you're on the v31 audit path, use DOGMAActiveLocalPromptV31 instead; it reads audit_hints rather than kind.
Common issues
Everything comes out as OBJECT. Your inventory lines didn't carry a recognised kind, and the node defaults to OBJECT for anything that isn't literally STRUCTURE or SURFACE. The prompt is still safe - conservative, in fact - it's just not tuned for a facade or a road.
The prompt is doing nothing visible. On a large, already-sharp region that's expected, and it's the honest result. Automated detailing is for the small broken parts of an otherwise-good render; a second pass over a good surface costs render time and buys nothing. If you can't see the change at viewing resolution, turn the sector off rather than raising denoise.
Seams at the crop edge. Not this node's problem, but the usual cause in this pipeline: the stitch or mask feather, not the prompt. Detail at native resolution before you upscale, and composite only the masked pixels back.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| category | STRING | — | |
| kind | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| info | STRING | — |