Nodes/ComfyUI-Egregora-ARMD/πŸ“ Egregora Restore Original Size
ComfyUI Node

πŸ“ Egregora Restore Original Size

The cleanup node that gives you back the framing you started with

By lucasgattasΒ·Created 5 months agoΒ·Updated about a month agoΒ· 0
πŸ“ Egregora Restore Original Size
  • image
  • region_plan
  • restored_image

The ARMD workflow pads your image before it starts. Egregora Region Plan aligns the canvas to a clean working resolution - usually with pad_reflect, which adds a ring of reflected pixels around your photo so the model gets an evenly-divisible canvas. That's great for denoising, but it means your beautiful regional upscale comes out with a border that isn't yours. Egregora Restore Original Size is the last node in the chain: it crops that padding back off and hands you the image at the original framing.

How it works

It's genuinely simple, and that's why it works. The node reads two things: your final image, and the region_plan from Egregora Region Plan. The plan carried the alignment metadata all along - original_width, original_height, and the pad_left/top/right/bottom amounts. Restore Original Size compares the plan's aligned dimensions against your actual output dimensions, scales the crop bounds accordingly (in case you upscaled in between), and crops the padding away.

Two edge cases worth knowing:

  • No padding, no crop. If the plan stored zero padding (a latent-driven blank canvas, or an image that happened to fit cleanly), the node returns your image untouched. It's safe to leave in the graph either way.
  • It works on the image, not the latent. You wire this after VAE decode - the typical spot being after VAE Decode Tiled in an upscaling workflow. There's no reason to run it before decode; it operates on pixel space.

What it can't do

The README is blunt here and it's the most important thing to understand: this node can restore padding, but it cannot restore cropping. If you set alignment_mode to floor_crop in the Region Plan, pixels are removed to reach a compatible size - that's a destructive operation, and no amount of post-processing is going to conjure them back. If you care about keeping your full original framing (you do), use pad_reflect. That's exactly why the README recommends it as the default: preserve, don't discard.

The interface

Only two inputs - image and region_plan - and one output, restored_image. There's nothing to tune, no settings to get wrong, no hidden knobs. If you build an ARMD upscaling workflow it just sits at the end of the chain, always on, and you forget it exists. That's the sign of a well-scoped utility node.

Installing

Same as every node in this pack:

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

restart ComfyUI, or search "ComfyUI-Egregora-ARMD" in ComfyUI Manager. No models to download, no heavy dependencies beyond what ComfyUI already runs (numpy, opencv-python, PyWavelets, torch). This pack is from Lucas Gattas (mrgattax), who keeps a small family of "Egregora" image-processing packs; like the rest, it's more research-flavored than polished-benchmarked, but this particular node is about as safe a bet as they come - it can only remove pixels you asked it to remove.

CategoryEgregora-ARMD

Inputs (2)

NameTypeDefaultDescription
imageIMAGEβ€”
region_planEGREGORA_REGION_PLANβ€”

Outputs (1)

NameTypeDescription
restored_imageIMAGEβ€”