DOGMA MaskLabReport 1.0.16
The contact sheet that tells you which mask method to trust
- results
- comparison_per_category
- overview
- timing_and_diagnostics
Five masking methods, one image, a column of numbers. The numbers alone will not tell you which one you should ship, because the failure that matters most - a mask that is geometrically perfect and covers the wrong thing - looks great in every statistic. You need to look at the masks.
This node turns the lab results into pictures. For each category it builds a contact sheet with a column per method, and within each column three rows: the original analysis image, the retained mask in black and white, and an overlay where retained pixels are tinted cyan and rejected candidates are tinted red. Method label and timing sit above each column, notes below. It also produces a stitched overview of all the sheets, and writes everything to disk if you ask it to.
How it works
The report reads the results object, sorts methods alphabetically for stable layout, resizes your analysis image to a fixed thumbnail width, and draws the sheets with PIL - the same three-view pattern (original / mask / overlay) the rest of the pack uses for its preview strips, which means once you have read one DOGMA preview you can read them all.
The text output is the part people skip and should not. It opens by stating that the timings are measurements from this run and not GPU-speed guarantees, then gives you a per-method line: seconds, image encodes, text searches, decoder calls. Per category it adds candidates detected, retained, coverage percentage, and every note the runner recorded, deduplicated. It explicitly flags that coverage is not accuracy, that geometry flags are heuristics rather than semantic validation, and that no diffusion, hole filling, or morphological closing happens anywhere in this pipeline. There is also a note that the masks are produced at the analysis resolution and the node makes no claim of native full-resolution detail.
If save_reports is on, it writes into ComfyUI/output/DOGMA_MASK_LAB/<timestamp>_<id>/: the analysis source as PNG, one PNG per category per method for both the retained mask and the rejected set, a JSON report, and a CSV whose rows are method, category, seconds, candidates, retained, coverage, notes. The CSV is the reason to bother - sort it, and you have an actual method comparison rather than a vibe.
Inputs and outputs
Inputs are just results (DOGMA_LAB_RESULTS, from DOGMAMaskLabRunV115) and save_reports (on by default).
Outputs: comparison_per_category (IMAGE, the detailed contact sheets), overview (IMAGE, all sheets stacked - the one to look at first), and timing_and_diagnostics (STRING).
Install
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
Or ComfyUI Manager → DOGMA Nodes, then restart. The pack's only pip requirement is scipy>=1.10. This node additionally wants a font it can find - it tries DejaVuSans, then Arial, then falls back to PIL's default bitmap font, so on a bare container you get small labels rather than an error.
How to actually use it
Look at the overview first and ask one question per category: which method's cyan region is the object, and which methods tinted a neighbour red for no good reason. Then check the numbers for the method that looked right - if it is three times slower for the same result, you have your answer too.
Two things to keep in mind. The category rows follow the plan's order, and a blank method column means that method found nothing for that category, not that it crashed. And when a sheet says NO MASK, resist the urge to raise the detection threshold immediately; a lower threshold with a bigger instance cap is usually what a genuinely small target needs.
Finally, note the direction of travel: this lab pairs with the pack's PrepMasksB production node, which implements the single-query-per-target path. The lab is where you find out whether that path can see your target at all, and which phrasing gets you closest.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| results | DOGMA_LAB_RESULTS | — | |
| save_reports | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| comparison_per_category | IMAGE | — |
| overview | IMAGE | — |
| timing_and_diagnostics | STRING | — |