Auto Aspect Unpad Comal
Putting your edited image back the way it was
- image
- pad_info
- IMAGE
Auto Aspect Unpad (Comal) is the restore half of a two-node pack, and if you only look at it in isolation it looks boring: two inputs, one image out. But it's the node that makes Qwen-Image-Edit edits land at the exact size and position you started with - and without it, the whole padding trick above it leaves you with black bars and a canvas that isn't yours.
Why it exists
The sibling node, Auto Aspect Pad, letterboxes your source image onto one of Qwen-Image-Edit's official aspect ratios at ~1MP so the encoder's internal forced rescale can't misalign your reference latent with your output latent. That fixes the zoom and drift - but it also means the sampler's output is a padded canvas, not your image. Auto Aspect Unpad is the "undo" that runs after KSampler and VAE Decode: it crops the letterbox bars back off and rescales the edited content to your original pixel dimensions. Pad makes the edit safe, Unpad makes it invisible.
What it takes in
Just two inputs, and the second one does the heavy lifting:
- image - the edited result straight out of VAE Decode.
- pad_info - the geometry bundle from Auto Aspect Pad, wired over unchanged.
That's the whole surface. pad_info isn't a plain image - it's a small record carrying your original width and height, the pixel offsets of the padding, the inner content size, and the interpolation mode. The Unpad node reads all of it, crops [pad_top:pad_top+inner_h, pad_left:pad_left+inner_w] out of the edited canvas, and resizes that inner region back to your original dimensions. Because the interpolation mode is stored in pad_info, it automatically uses the same resampling Pad used - you don't have to remember which one you set, and you can't accidentally mismatch them.
Output is a single IMAGE at your source resolution, ready to drop into Preview or Save. It's worth being precise that it restores the image only: if you carried a mask through the edit, Pad's mask output is what keeps the mask aligned, and Unpad doesn't hand the mask back - crop and resize that yourself if you need it downstream.
How to install it
Same pack, same install as Pad - it ships together in comal0731/auto_aspect_ratio. Via ComfyUI Manager, search "Comal" or "Auto Aspect" and install, then restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/comal0731/auto_aspect_ratio.git comal-auto
No requirements.txt, no model files, no dependencies beyond the torch/PIL ComfyUI already ships. MIT license. Note the README is in Korean; the node UI is English.
Where people get burned
The failure mode here is almost always a broken pairing, not a broken node. pad_info must come from the Pad node that processed the same input image - it's a contract between the two nodes, not a general-purpose crop node. Bypass Pad, and Unpad will happily crop a slice out of whatever you feed it based on stale geometry. Bypass Unpad, and you're left staring at letterbox bars. Wire pad_info straight through, keep Pad and Unpad as an intact pair on each image branch, and the round-trip is genuinely pixel-consistent - which is more than the default Qwen-Edit workflow can claim.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| pad_info | PADINFO | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |