Nodes/DOGMA Nodes/DOGMA Categories8 v1.0.11
ComfyUI Node

DOGMA Categories8 v1.0.11

Bundle eight mask sets into one wire, previews included

By axior·Created 6 months ago·Updated 16 days ago· 2
DOGMA Categories8 v1.0.11
  • image
  • mask_1
  • mask_2
  • mask_3
  • mask_4
  • mask_5
  • mask_6
  • mask_7
  • mask_8
  • categories
  • category_previews
  • category_names
◄category_1—►
◄category_2—►
◄category_3—►
◄category_4—►
◄category_5—►
◄category_6—►
◄category_7—►
◄category_8—►

What it is

If you've ever built a multi-category masking graph in ComfyUI, you know the shape of the problem: eight parallel chains - search, audit, finish - eight mask batches arriving at the render end, and a canvas full of wires you can no longer read. DOGMACategories8V111 is the collector. Wire eight mask/category pairs in, get one DOGMA_CATEGORIES bundle out, plus a preview image and a status string.

The bundle is a plain dict with the eight entries in it - each entry carries its slot number, its category name, its masks, and a flag for whether it's active. One wire instead of sixteen, and - more usefully - stable slot IDs. Slot 3 is slot 3 whatever order the masks arrive in, which is what makes the interactive chooser downstream able to talk about "category 3" rather than "the third thing that happened to be in the list."

How the previews work

For every slot that's actually active, the node renders a card: the source image, the mask, and a cyan overlay, side by side at up to 768px on the long side, with a banner reading 3. person | original / mask / overlay. The cards are stacked vertically into one image batch. That single batch is what the chooser node displays, so you can look at eight categories at a glance instead of clicking through eight preview nodes.

A slot counts as active when both of these are true: the category string isn't one of the pack's inactive tokens (none, unused, n/a, absent - synonyms are canonicalised, so buildings/building collapse too), and the mask tensor is non-empty with at least one pixel above 0.5. Everything else is reported as inactive / empty in the status string and contributes no card.

If nothing is active at all, you get a small placeholder image (1×64×192) rather than an exception, and the node still emits a valid bundle. That matters, because the chooser and the release-selection node both expect a bundle and would fall over on None.

Inputs and outputs

All eight pairs are required inputs, and that's worth reading twice before you wire it up:

  • image - the source image the masks were computed on.
  • mask_1…mask_8 (MASK) and category_1…category_8 (STRING, forced to a wire - no typing) - in slot order.

Because they're required rather than optional, ComfyUI will refuse to run the node with unconnected slots; you can't leave 5–8 dangling and only use four. Feed empty or zero masks for the unused ones and let the activity check skip them, which keeps a saved workflow reusable across scenes where different categories exist.

Outputs:

  • categories (DOGMA_CATEGORIES) - feed it to DOGMAChooseCategoriesV111.
  • category_previews (IMAGE) - the stacked cards. Usable on any Preview Image node too, which is how you sanity-check a run without opening the chooser.
  • category_names (STRING) - one line per slot, e.g. 3. person: available or 7. vegetation: inactive / empty.

Where it fits

This is the join point of the "many categories, one scene" pattern that promptable segmenters made practical. The masking doc's framing is the right one: a promptable segmenter is just a detector, and the reason to run eight categories instead of one is that each category gets its own query, its own threshold and its own audit - you can be strict about person masks without making road masks impossible. Categories8 is where those eight independent pipelines get folded back into something a graph can carry.

Two practical notes. First, every mask in a slot gets unioned at preview time and downscaled with nearest-neighbour, so previews are honest about shape but not anti-aliased. Second, this node does no processing at all - no thresholding, no ownership resolution, no cleanup. It's a collector. If masks from different categories overlap and you care which one wins, the ownership node is the next stop, and it's a separate decision.

Install

Manager → search DOGMA Nodes (publisher axior, registry name comfyui-dogma-nodes), or:

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

requirements.txt declares scipy>=1.10 - that's the entire Python dependency list - and the pack downloads no models or checkpoints. It also ships a small frontend extension (web_v111/) for the interactive category chooser, so a restart after install is genuinely required, not a formality. The SAM 3 node and VLM that feed your masks are separate installs; the KB's note that ComfyUI's SAM 3 path wants Triton, and is therefore rougher on Windows, applies to them rather than to this node.

CategoryDOGMA/v1.0.11

Inputs (17)

NameTypeDefaultDescription
imageIMAGE—
mask_1MASK—
category_1STRING—
mask_2MASK—
category_2STRING—
mask_3MASK—
category_3STRING—
mask_4MASK—
category_4STRING—
mask_5MASK—
category_5STRING—
mask_6MASK—
category_6STRING—
mask_7MASK—
category_7STRING—
mask_8MASK—
category_8STRING—

Outputs (3)

NameTypeDescription
categoriesDOGMA_CATEGORIES—
category_previewsIMAGE—
category_namesSTRING—