Nodes/ComfyUI-Egregora-ARMD/🧭 Egregora Region Plan
ComfyUI Node

🧭 Egregora Region Plan

The node that decides where every region lives β€” and the one setting most people get wrong

By lucasgattasΒ·Created 5 months agoΒ·Updated about a month agoΒ· 0
🧭 Egregora Region Plan
  • image
  • latent
  • aligned_image
  • regions_batch
  • regions_list
  • region_plan
  • region_count
  • region_order_text
β—„region_width1024β–Ί
β—„region_height1024β–Ί
β—„region_overlap384β–Ί
β—„blend_feather64β–Ί
β—„compression8β–Ί
β—„alignment_modepad_reflectβ–Ί

If you're using the Egregora-ARMD pack at all, this is where every run starts. Egregora Region Plan is the backbone of the whole "Adaptive Regional Mixture of Diffusers" idea: it takes your source image (or a latent canvas) and turns it into the spatial contract every other node in the pack reads. Feed it the wrong settings and nothing downstream can save you - so it's worth five minutes to understand what it actually does.

The core + context + feather idea

ARMD's whole trick, borrowed from a line of shared-canvas diffusion research (MultiDiffusion, Mixture of Diffusers, DemoFusion), is that each region gets three bounding boxes:

  • a core - the area that genuinely belongs to that region's prompt,
  • a context - an expanded crop so the model still sees its neighbors while denoising,
  • a write-back box with a feather - a soft ramp so the region blends back into the canvas without stamping a hard seam.

This node computes all of that. It also aligns the canvas to a clean working resolution first, which is why its outputs include an aligned_image that may be slightly larger than what you fed in.

The inputs that matter

The defaults are actually decent, and the README's recommendations are worth trusting:

  • region_width / region_height (default 1024) - tile scale. This is the setting most people get wrong: think of it as how big a piece of scene one prompt owns, not output resolution. Smaller tiles = more regions = more VRAM pressure per pass and more places for seams to hide.
  • region_overlap (default 384) - becomes the context padding around each core. Rule of thumb: 1/3 to 3/8 of the tile size, so 384 for 1024 tiles, 256 for 768, 192 for 512.
  • blend_feather (default 64) - the soft transition on write-back, roughly 1/16 to 1/8 of tile size. Too small and you'll see the regions; too big and regions start leaking into each other.
  • compression (default 8) - the VAE's latent-to-pixel ratio. This is why all the geometry is computed in latent space and multiplied back up.
  • alignment_mode - pad_reflect (default) pads the canvas to a clean size with reflect padding; floor_crop crops instead. Use pad_reflect. Cropping throws pixels away, and nothing downstream can get them back.

One hard constraint that bites people: region_width, region_height, region_overlap and blend_feather must all be divisible by compression, or the node raises a ValueError. With defaults that's a non-issue (1024/384/64 are all divisible by 8); the moment you start poking at custom sizes, keep it in mind.

You can feed it an IMAGE, a LATENT, or both. Image-only is fine for upscaling. For blank-canvas generation from scratch, use a latent (an Empty Latent node) as the source of truth for canvas size. When both are present, it runs an exact-canvas fitting path so the image lands exactly on the latent's dimensions instead of being reflect-padded arbitrarily.

What comes out

The output that matters for the rest of the workflow is region_plan (the EGREGORA_REGION_PLAN object) - wire that into Regional Conditioning, Adaptive Diffusion Apply, and Restore Original Size. You also get:

  • aligned_image - the padded canvas,
  • regions_batch and regions_list - the extracted region crops (list is per-region, handy for previewing),
  • region_count - the number of regions, which you must match with prompts,
  • region_order_text - a human-readable dump of every region's core/context/write-back boxes in pixel and latent space. If you're writing prompts by hand, this is your map.

Installation

Everything in this pack installs the same way:

cd ComfyUI/custom_nodes
git clone https://github.com/lucasgattas/ComfyUI-Egregora-ARMD

then restart ComfyUI. Or just use ComfyUI Manager and search for "ComfyUI-Egregora-ARMD". Dependencies are light - numpy, opencv-python, PyWavelets, torch - and there are no model downloads; it uses whatever SDXL or Z-Image Turbo checkpoint you already have. It's a research-flavored pack (the README says so plainly - no formal benchmarks, just open implementation), so expect to tune region sizes rather than paste in a workflow and be done.

A couple of things to know

Region numbering is row-major, region 1 = row 0, column 0. And if you check the logs and see regions processing in an order that doesn't look spatial - that's normal. The runtime re-sorts batches by context-box size and prompt length for efficiency; the output is still accumulated back into the spatially correct canvas position.

CategoryEgregora-ARMD

Inputs (8)

NameTypeDefaultDescription
region_widthINT102464–8192β€”
region_heightINT102464–8192β€”
region_overlapINT3840–2048β€”
blend_featherINT640–512β€”
compressionINT81–16β€”
alignment_modeCOMBOpad_reflect2 options: pad_reflect, floor_crop
imageoptIMAGEβ€”
latentoptLATENTβ€”

Outputs (6)

NameTypeDescription
aligned_imageIMAGEβ€”
regions_batchIMAGEβ€”
regions_listIMAGEβ€”
region_planEGREGORA_REGION_PLANβ€”
region_countINTβ€”
region_order_textSTRINGβ€”