DOGMA v56.4 Automatic Mask Audit Sheet
Build the contact sheet that lets a VLM actually audit your masks
- image
- mask_1
- mask_2
- mask_3
- mask_4
- mask_5
- audit_sheet
- audit_prompt
- info
The premise of this node is a specific, well-earned distrust: a segmentation model handed the phrase "buildings" will sometimes return the pavement. Not often. Occasionally. Exactly often enough that an unattended batch of two hundred crops has a few ruined regions in it, and the failure is invisible until you look.
DOGMAMaskAuditSheetV564 builds the artifact that lets you ask about it. It does not change a single mask.
What it produces
You give it the source image, five MASK slots with five matching categories, and panel_max_side (a panel size, default 320). It gives you back three things:
audit_sheet - a 2×3 contact sheet. Top-left panel is the original image, darkened. The other five panels are each slot's selection: unselected pixels stay dark but visible so the model can still read the scene, and selected pixels are painted bright cyan. One image, six panels, small enough that a vision model can look at all five selections in a single pass. That matters - five separate VLM calls is five times the VRAM pressure and five chances for the model to lose track of which slot it's looking at.
audit_prompt - the instruction to send with that sheet. This is the part worth explaining. It is a careful, opinionated rubric: the panel order is spelled out row-major (original first, then slot 1 through 5); the category for each slot is listed by name; the model must decide per slot whether the cyan region is safe to send to an image-restoration inpaint for that category; it must PASS a usable mask even if it misses instances, has holes, has imperfect edges, or is deliberately broad; it must FAIL only on clear substantial contamination - a large unrelated surface selected, mostly-the-wrong-thing, or the category simply absent. It gives worked examples of FAIL (floor selected as part of a building mask, sky selected as part of a lamp mask) and explicitly forbids failing a mask because the category could be more specific or because a colour or material wasn't captured. none slots fail by definition.
Then the output format: exactly five lines, slot order, nothing but PASS or FAIL.
That rubric is the whole value of the node. A generic "is this mask good?" question gets you a chatty, inconsistent answer you can't parse. This one is written to produce five tokens.
info - per-slot coverage percentages, e.g. slot1 buildings=18.42% | slot2 road=31.07% …. Read it before you trust anything else: a slot at 0.02% coverage on a category that should be everywhere is a masker problem, not an audit problem.
Wiring it
audit_sheet into your VLM node's image input, audit_prompt into that node's text instruction, and the VLM's five-line reply into DOGMAMaskAuditGateV564. That's the loop: sheet and gate are a matched pair, and the sheet's prompt is written to the contract the gate parses.
Inputs and outputs
image, mask_1–mask_5, category_1–category_5, panel_max_side. Out: audit_sheet, audit_prompt, info.
Install
ComfyUI Manager → search DOGMA Nodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
Restart. Nothing to pip install and no weights to download - this is pure tensor compositing with PyTorch.
Where it bites
panel_max_side is a real trade. Bigger panels make small selections legible to the VLM; smaller panels fit more visual context and load faster. 320 is a sane default; if your masks are tiny objects in a huge frame, push it up to 512 and accept the cost.
Five slots is fixed. If your planner emits six categories, you're auditing five of them - pick the ones whose failure would hurt most.
And a mask that's empty renders as a fully dark panel, which the rubric is fine with (missing instances pass), but it means "the masker found nothing" and "the masker found something wrong" look similar in the sheet. Check info for the coverage number to tell them apart.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask_1 | MASK | — | |
| mask_2 | MASK | — | |
| mask_3 | MASK | — | |
| mask_4 | MASK | — | |
| mask_5 | MASK | — | |
| category_1 | STRING | — | |
| category_2 | STRING | — | |
| category_3 | STRING | — | |
| category_4 | STRING | — | |
| category_5 | STRING | — | |
| panel_max_side | INT | 320192–512 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| audit_sheet | IMAGE | — |
| audit_prompt | STRING | — |
| info | STRING | — |