π Egregora Adaptive Diffusion Apply
The engine of ARMD β where the regional denoising actually happens
- model
- region_plan
- regional_positive
- regional_negative
- runtime_payload_adapter
- model
This is the node that does the work. Everything else in the Egregora-ARMD pack prepares data; Egregora Adaptive Diffusion Apply is where your model gets handed over to the regional denoising engine. If you've built the region plan and encoded the prompts, this is the piece that makes them mean something during sampling.
What it actually does
The mechanism is a ComfyUI model patch: the node clones your model and installs a UNet function wrapper on it (under the hood that's set_model_unet_function_wrapper). From then on, every denoising pass goes through a regional mixer instead of straight through the UNet.
Here's the shape of a single pass:
- The incoming latent is validated against the region plan's expected dimensions - a mismatch here throws an error rather than silently corrupting.
- The latent is sliced into context-region crops (the expanded boxes from the plan, so each region still sees its neighbors).
- Each region's own conditioning - its prompt, its negative, its SDXL
pooled_outputif the architecture uses one - is injected per-region. - Each batch of regions is denoised with
model_function, then accumulated back onto a shared canvas with feathered weights: full weight in the core, a smooth linear ramp in the overlap zone, normalized through a weight accumulator.
That last bit is the whole point. Independent tiles invent structure separately and then fight at the seams; ARMD lets neighboring regions stay aware of each other (through the context crops) while writing back softly enough that no region owns a hard boundary. That's the difference between this and "tiled img2img with prompts," and it's why it holds up better at higher denoise.
The inputs that matter
- model - any checkpoint's model you want to run regionally. SDXL and Z-Image Turbo are the pack's stated sweet spot.
- region_plan - from Egregora Region Plan. Must be the same plan that generated the conditioning, or you'll get a region-count mismatch error.
- regional_positive / regional_negative - the
EGREGORA_REGIONAL_CONDITIONINGoutputs from Egregora Regional Conditioning. The count check is strict: if your positives and negatives don't both match the plan's region count, it raises rather than half-working. - region_batch_size (default 4) - how many regions get denoised per batch. Lower = less VRAM, more passes; higher = faster but hungrier. This is your memory-vs-speed knob.
- debug_runtime (default false) - turns on logging of
region_count,batch_count, and which region indices land in which batch. Turn it on when you're suspicious the order is wrong or a region looks misplaced.
There's also an optional runtime_payload_adapter input - that's the advanced plumbing for injecting extra tensors or flags at runtime, which you'd build with the pack's payload nodes (Spatial Tensor Pack, Static Payload Pack, Runtime Adapter Merge). Skip it until you actually have a reason.
The output
One output: the patched model. Wire it into your KSampler just like a normal model. The patch is per-clone, so your base model stays untouched - you can run regional and non-regional branches side by side in the same graph.
A workflow looks like: Region Plan β Regional Conditioning β Adaptive Diffusion Apply β KSampler (denoise below 1.0 for upscaling, 1.0 for blank-canvas generation) β VAE Decode Tiled β Restore Original Size.
Installing and gotchas
cd ComfyUI/custom_nodes
git clone https://github.com/lucasgattas/ComfyUI-Egregora-ARMD
then restart ComfyUI, or install "ComfyUI-Egregora-ARMD" via ComfyUI Manager. No model downloads; the pack's dependencies are just numpy, opencv-python, PyWavelets and torch.
Two things to keep in mind. First, the log order may not match spatial order - v0.1.2 batches regions by context-box size and then by prompt length to cut cross-attention padding, so a debug log can show region 7 before region 2 while the final image is still spatially correct. Don't panic, verify with debug_runtime. Second, this pack is honest about being research-grade: no formal benchmarks, a small community footprint, and it's designed for SDXL / Z-Image Turbo rather than every architecture. If your model's conditioning layout is exotic, expect to fiddle.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | β | |
| region_plan | EGREGORA_REGION_PLAN | β | |
| regional_positive | EGREGORA_REGIONAL_CONDITIONING | β | |
| regional_negative | EGREGORA_REGIONAL_CONDITIONING | β | |
| region_batch_size | INT | 41β128 | β |
| debug_runtime | BOOLEAN | false | β |
| runtime_payload_adapteropt | EGREGORA_RUNTIME_PAYLOAD_ADAPTER | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | β |