π§ Egregora Region Plan
The node that decides where every region lives β and the one setting most people get wrong
- image
- latent
- aligned_image
- regions_batch
- regions_list
- region_plan
- region_count
- region_order_text
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_cropcrops instead. Usepad_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_batchandregions_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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| region_width | INT | 102464β8192 | β |
| region_height | INT | 102464β8192 | β |
| region_overlap | INT | 3840β2048 | β |
| blend_feather | INT | 640β512 | β |
| compression | INT | 81β16 | β |
| alignment_mode | COMBO | pad_reflect | 2 options: pad_reflect, floor_crop |
| imageopt | IMAGE | β | |
| latentopt | LATENT | β |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| aligned_image | IMAGE | β |
| regions_batch | IMAGE | β |
| regions_list | IMAGE | β |
| region_plan | EGREGORA_REGION_PLAN | β |
| region_count | INT | β |
| region_order_text | STRING | β |