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

DOGMA ChooseCategories v1.0.11

Pause the queue and tick which masks you actually want rendered

By axior·Created 6 months ago·Updated 16 days ago· 2
DOGMA ChooseCategories v1.0.11
  • categories
  • previews
  • selected_categories
  • selection_report
◄manualfalse►

What it is

A decision point in the middle of a graph, rendered as a modal dialog. DOGMAChooseCategoriesV111 takes the eight-category bundle from DOGMACategories8V111 plus its preview cards, and hands back the same bundle with a selection attached - the slots you approved. Everything downstream that respects the selection (the ownership resolver, the crop nodes, the render branch) then works on your choice, and unselected categories don't claim pixels, don't run captions, don't run diffusion.

In auto mode that's trivial: every active category gets selected and the graph runs unattended. Flip manual on and the whole thing stops mid-run, shows you the preview cards as a checkbox grid, and waits for you to click.

How the pause actually works

This is the part worth understanding, because it's unusual and it's implemented entirely in this pack - no extra frontend pack needed:

  1. The node saves the preview batch to ComfyUI's temp folder and mints a random token.
  2. It registers a pending entry server-side and fires a websocket event to the frontend.
  3. web_v111/dogma_categories.js opens a <dialog> with one card per available category - thumbnail of the original/mask/overlay strip, a checkbox, and click-to-zoom. The panel has its own reopen button and the server exposes a pending-list route, so a browser refresh doesn't strand you.
  4. Submitting POSTs the ticked slot IDs back to a POST /dogma/categories/select route. The route validates the token, rejects duplicates and IDs outside the allowed set, and stores the selection.
  5. The node polls every 0.2 seconds, checks ComfyUI's processing-interrupted flag each tick, and clears the pending state in a finally block so a cancel or a crash doesn't leave a zombie token.

Two consequences fall out of that design. First, the queue looks hung. It isn't - the node is deliberately blocking execution until you answer, and the rest of the graph is waiting. Second, an empty selection is a legitimate answer, not a cancel: you get the bundle with nothing selected, and the pipeline's own logic passes the source image through untouched.

Small thing you'll notice immediately: the dialog's own copy is in Italian ("Scegli le categorie da lavorare"). Cosmetic, and it tells you exactly whose workflow this was extracted from.

Inputs and outputs

  • categories (DOGMA_CATEGORIES) - the bundle to choose from.
  • previews (IMAGE) - the stacked preview cards that get shown and saved for the panel.
  • manual (boolean, default false) - false means auto-select everything active; true means block and ask.

Outputs:

  • selected_categories (DOGMA_CATEGORIES) - the input bundle with a selected list of slot IDs added.
  • selection_report (STRING) - MANUAL or AUTO, then the names of what got selected, or the explicit line about an empty selection causing a pass-through.

The caching trap

With manual on, the node's IS_CHANGED returns float("nan"). That's the standard ComfyUI idiom for "always re-run me" - NaN != NaN, so the cache comparison always comes back dirty. Without it, ComfyUI would happily cache the node's output and you'd press Queue a second time and get… the previous run's categories, with no dialog.

The flip side is documented ComfyUI behaviour you should know: an always-dirty node defeats output caching for everything behind it. With manual off you get False, cache works normally, auto-selection is free. With manual on, expect the pipeline upstream of this node to re-execute every single queue - and for reruns on a large scene, that's the cost of the interaction, not a bug.

Install

Manager → search DOGMA Nodes, or:

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

The restart is what loads the pack's WEB_DIRECTORY and registers the /dogma/categories/* routes - if you install the Python files by hand and skip a full restart, the node will sit there forever waiting for a dialog that can never open. scipy>=1.10 is the only Python dependency; no models are downloaded.

Where this earns its keep is the workflow it was built for: eight categories, probabilistic VLM-audited masks, and a render pass expensive enough that "which categories fire" is a real budget decision rather than a cosmetic one. If you're masking one thing, manual is an unnecessary blocker - leave it off, or use any of the ordinary switch nodes for the same job with less machinery. If the masks might be wrong and only you can tell, this is a nicer answer than re-queueing the whole scene with a category disabled.

CategoryDOGMA/v1.0.11

Inputs (3)

NameTypeDefaultDescription
categoriesDOGMA_CATEGORIES—
previewsIMAGE—
manualBOOLEANfalse—

Outputs (2)

NameTypeDescription
selected_categoriesDOGMA_CATEGORIES—
selection_reportSTRING—