DOGMA MaskLabRun 1.0.16
Five masking strategies, same image, timed
- image
- plan
- model
- clip
- DOGMA_LAB_RESULTS
Promptable segmentation has more ways to go wrong than most people expect. The text query might not be understood. The mask might be geometrically clean and semantically wrong. A second, differently worded pass might catch what the first missed. Trying "one query, see what happens" across your whole pipeline is slow, and you learn very little from a single result.
This node is a lab bench. It takes one image and one plan, and runs five different masking strategies over the same source, timing each one and recording how many candidates it found and how many survived. You then compare them side by side. It is a measurement tool, not a production node - nothing downstream consumes its output except the report node.
The five methods
Each letter is a different way of getting from a text query to a mask:
A raw text one prompt, straight detection
B presence + geometry geometric filtering on the result
C two-prompt agreement primary and secondary query must agree
D box + point decoder detector box plus the point decoder
E four overlapping views tiles the image and searches each
Method E is the one that most often rescues a small or partly occluded target, because it gives SAM a bigger relative view of the region. It is also the slowest. Method C catches the opposite failure: masks that only exist because one phrasing hallucinated them.
How it works
The node encodes every query your plan needs - primary terms always, secondary terms only when method C is enabled - through your CLIP, handling the SAM multi-condition metadata, and caches them so a repeated term is encoded once. It then loads SAM and prepares the image features once, and runs each enabled method against those shared features, clearing session counters between methods so the per-method backbone, detection, and decoder counts are honest.
Method order is the alphabet unless you switch reverse_order on, which exists so you can tell warm-up effects from real differences: run the same methods in the opposite order and see whether the timings follow the method or the order.
The instrumentation is what you are actually buying. Per method you get elapsed seconds, number of image encodings, number of text searches, number of decoder calls, and per category the candidate count, the retained count, coverage percentage, and the notes explaining every rejection. Coverage is not accuracy, and the node's own report says so in as many words - a large mask that swallowed the background has high coverage and is worthless.
Inputs and outputs
image and plan (DOGMA_LAB_PLAN, from the lab's planning node) are the real inputs; model and clip are the SAM pair, lazy. The tuning set is analysis_side (1536), score_threshold (0.35), max_instances (12), max_mask_coverage (0.97), min_box_agreement (0.85), refinement_budget (8), tile_overlap (0.2), and rerun. Then one boolean per method: run_A through run_E, all on by default. Turn off what you are not comparing - that is where the time savings are.
One output: DOGMA_LAB_RESULTS, which goes to the report node and nowhere else.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
Or ComfyUI Manager → DOGMA Nodes. scipy>=1.10 is the pack's only declared pip dependency. Beyond that you need the lab's planning node from the same generation and a SAM checkpoint loadable as a ComfyUI model, plus its CLIP - otherwise the lazy inputs light up and you have nothing to plug in.
Where people get burned
Assuming the timings are a benchmark. They are measurements on your run, on your hardware, with whatever was already warm. The pack says exactly this in the report header, and it tells you to re-run with the order reversed to check for warm-up skew. It also excludes checkpoint loading from disk and report writing, so do not compare these numbers to a ComfyUI queue duration and conclude something is wrong.
Reading the flags as verdicts. Everything here is geometry and counting. A mask marked retained is not a mask that found the right object; a red exclusion is a heuristic, and the coverage guard can legitimately reject a surface that fills the frame because that really is what the surface looks like.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| plan | DOGMA_LAB_PLAN | — | |
| model | MODEL | — | |
| clip | CLIP | — | |
| analysis_side | INT | 1536768–2560 | — |
| score_threshold | FLOAT | 0.350.05–0.95 | — |
| max_instances | INT | 121–32 | — |
| max_mask_coverage | FLOAT | 0.970.5–1 | — |
| min_box_agreement | FLOAT | 0.850–1 | — |
| refinement_budget | INT | 80–24 | — |
| tile_overlap | FLOAT | 0.200.05–0.4 | — |
| reverse_order | BOOLEAN | false | — |
| rerun | INT | 00–999999 | — |
| run_A | BOOLEAN | true | — |
| run_B | BOOLEAN | true | — |
| run_C | BOOLEAN | true | — |
| run_D | BOOLEAN | true | — |
| run_E | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DOGMA_LAB_RESULTS | DOGMA_LAB_RESULTS | — |