DOGMA - Ritagli nativi o elemento intero
One crop or many, per category
- selection
- crop_jobs
- selected_masks_after_ownership
- crop_geometry_and_time
The display name is the design decision: native crops or whole element. For every category you flagged in the chooser, this node either cuts the usual native-resolution tiles, or - when the Evita Blocchi switch is on - keeps the entire element in a single crop whose long side is capped at 2048 or 3072 with the aspect ratio preserved.
Why both are on the menu. Tiling a big flat surface is cheaper per inference and gives the model local detail to work with, but the seams between tiles show up as blocks, and the blockier the surface the more obvious it is. Rendering the whole element in one pass removes the seams entirely, at the cost of one downscale to fit the cap - and one inference instead of several.
How it works
This is DOGMAPhase3CropsV122 with two changes. First, context_px defaults to 256 instead of 160, so each crop carries more surrounding photograph by default. Second, it adds whole_region_side, validated to be exactly 2048 or 3072 - anything else raises, which is the pack refusing to let you set a value it never tested.
The whole-region path is a separate crop maker. It finds the full extent of the instance's mask, adds context, and if the crop exceeds the cap it downscales with a bicubic, antialiased resample. Two details in there are worth knowing about, because they are the exact places this can bite. It resamples the mask with nearest-neighbour and then checks that something survived - if the downscale erased a very thin mask, the node raises and tells you to disable Evita Blocchi for that element. And for a category classified as a continuous surface, it unions the instance masks first, so foreground objects splitting a wall's visible mask do not turn it into three separate crops.
Everything else is unchanged from 1.0.22: ownership resolution, per-instance isolation, the budgets, the DEFERRED reporting, and the denoise values stamped in from the chooser.
Inputs that matter
- selection - the category bundle from
DOGMAChooseCategoriesV124, carrying both the denoise map and the Evita Blocchi flags. - whole_region_side (3072) - the whole-element cap. 2048 means a bigger downscale and a lighter render; 3072 means more pixels and more VRAM.
- context_px (256) - padding around each element.
- The rest is the 1.0.22 set: overlap_policy, target_long_side, group_gap_px, max_objects_per_chunk, max_chunks_per_category, max_total_crops.
Outputs: crop_jobs (DOGMA_PREP_CROPS), selected_masks_after_ownership (IMAGE), crop_geometry_and_time (STRING). The geometry report names each element's mode and gives you the source-to-render size mapping, e.g. source 1400x900 -> render 1400x900; limit 3072px.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes
Manager users: search DOGMA Nodes. scipy>=1.10 is the pack's only pip dependency; restart ComfyUI after cloning so the new node IDs register.
Choosing between the two modes
Whole-element for anything whose continuity matters: a painted wall, a long signboard, a road surface, a shopfront panel. One pass, no seams, one prompt covering the whole thing - which also means a single prompt has to describe the entire element, and that is the trade. If the element contains several distinct things you want to control separately, tiling is the better fit.
Native tiles for anything thin, tall, or heavily occluded, and for small objects where downscaling would cost you the detail you came for. A thin painted line is the pathological case; the node will tell you rather than silently render nothing.
One more thing: this changes crop count, which changes your render time and your memory footprint a lot more than it changes any single setting. A 48-crop budget rendered as whole elements is a very different job from 48 tiles.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| selection | DOGMA_CATEGORIES | — | |
| overlap_policy | COMBO | 1 options: smaller_regions_first | |
| target_long_side | INT | 2048512–4096 | — |
| group_gap_px | INT | 1800–1200 | — |
| context_px | INT | 25632–640 | — |
| max_objects_per_chunk | INT | 11–1 | — |
| max_chunks_per_category | INT | 241–24 | — |
| max_total_crops | INT | 481–96 | — |
| whole_region_side | INT | 30722048–3072 | Evita Blocchi: lato lungo massimo, rapporto di aspetto preservato. Riduce solo se necessario; nessuna divisione in tile di sampling. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| crop_jobs | DOGMA_PREP_CROPS | — |
| selected_masks_after_ownership | IMAGE | — |
| crop_geometry_and_time | STRING | — |