Nodes/DOGMA Nodes/DOGMA SAMCoverage v1.0.10
ComfyUI Node

DOGMA SAMCoverage v1.0.10

Text-prompted SAM 3 with a real budget and no shape police

By axior·Created 6 months ago·Updated 16 days ago· 2
DOGMA SAMCoverage v1.0.10
  • image
  • model
  • clip
  • previous
  • candidates
  • search_report
◄category—►
◄query_hint—►
◄mode▾►
◄threshold0.25►
◄max_instances32►
◄max_queries3►
◄recovery_views4►
◄refine_iterations4►
◄after—►

Text-prompted segmentation is one of the genuinely useful things to come out of SAM 3: describe the region in words and it finds the thing, no trained detector required. The catch, if you've ever wired it up yourself, is that it's a research node in a production pipeline - it will happily return 150 candidates, it has no notion of a per-category budget, and its masks arrive however the model felt that day.

SAMCoverage v1.0.10 is the pack's production wrapper around it. It's the release that put DOGMA's phase-3 masks back to working after the 1.0.9 box-only decoder experiment, and if you're building a category masking pipeline from scratch, this is the search node to copy.

How it works

You give it a source image, a SAM 3 model, the clip its text encoder needs, a category and a query_hint. It builds a query list - the pack's broad family term first (people → person), then your hint's semicolon-separated specifics, then the family's other aliases - capped by max_queries. Then, per job, it encodes the query with CLIPTextEncode, runs SAM3_Detect with your threshold and refine_iterations, and forwards max_detections into the SAM node's conditioning metadata.

Two things there are the release's whole point.

Mask preservation. Earlier DOGMA versions clipped masks to detector boxes and rejected them on density, dominant-component ratio or completeness. v1.0.10 keeps what SAM returns: masks with holes, masks with disconnected visible components, partial objects, real openings. Only malformed, non-finite, empty/tiny (under 4 pixels) or score-less masks get dropped. That's the fix for "my arch came back as two pillars and a missing sky."

Bounded work. The cap is cumulative per category - max_instances counts detections examined, not masks kept, and the running total is carried in the notes so a later recovery pass can't reset it. A slice of the budget - min(max_instances // 4, recovery_views * 2) - is reserved for spatial recovery independently of the audit verdicts, so a category where some objects passed audit can still be hunted for the missing ones. If a core SAM implementation ignores the cap, over-limit outputs are truncated and sorted by score rather than raising the old "128 objects" error, and duplicates are dropped by containment in a shared helper.

In local_recovery mode the jobs become the pack's four overlapping 64% windows instead of the whole frame - which is also where the "one category per node, two passes" pattern comes from: global first, then a recovery pass fed by previous.

The inputs and outputs

  • image - one image. A batch raises DOGMA: one source image required.
  • model / clip - SAM 3 and its text encoder.
  • category / query_hint - the category name and the specific nouns from your planner.
  • mode, threshold (0.25), max_instances (32), max_queries (3), recovery_views (4), refine_iterations (4) - the search shape.
  • previous (DOGMA_REVIEW, optional) - required for local recovery; must match category and image size.
  • after - an optional passthrough string input the pipeline uses to keep node ordering honest.
  • candidates (DOGMA_CANDIDATES) → audit node → DOGMA ReviewBatch v1.0.10.
  • search_report (STRING) - searches, detections examined, invalid dropped, masks kept, cap used. "A search cap can leave objects uncovered" is printed for you.

Install

Manager → search DOGMA Nodes, or:

cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes

Restart. Only scipy>=1.10 is installed, but the node needs a ComfyUI exposing SAM3_Detect - and on Windows that path wants Triton, plus SAM 3 has a habit of leaving large temp directories behind (sam3_* in your temp folder). Check disk before you blame the masks.

Honest read

This is one of the pack's better-behaved nodes: no per-category tile budgets to tune, no geometry thresholds to fight, sensible defaults, and a report that tells you when it stopped early. Its own changelog warns that the release was validated with CPU regressions and simulated model calls - "coverage and model segmentation quality require a real-image check" - and that report-only auditing retains incorrect SAM selections. So the node gives you candidates and a budget, not correctness. The audit pass is what earns that.

CategoryDOGMA/v1.0.10

Inputs (13)

NameTypeDefaultDescription
imageIMAGE—
modelMODEL—
clipCLIP—
categorySTRING—
query_hintSTRING—
modeCOMBO2 options: global, local_recovery
thresholdFLOAT0.250.05–0.9—
max_instancesINT328–64—
max_queriesINT31–4—
recovery_viewsINT40–4—
refine_iterationsINT40–5—
previousoptDOGMA_REVIEW—
afteroptSTRING—

Outputs (2)

NameTypeDescription
candidatesDOGMA_CANDIDATES—
search_reportSTRING—