Pad Image For Outpainting (EmAySee)
Grow your canvas and get the mask that marks the new space
- image
- IMAGE
- MASK
EmAySee Pad Image For Outpainting takes an image, pads it on any of its four sides, and hands you both the padded image and a mask that marks exactly where the new pixels are. That pair is the entire setup for classic masked outpainting: your original pixels stay put, the blank canvas around them is the region you regenerate, and the mask tells the sampler "only touch here."
This is the mask-based outpainting route, and it's worth being clear about where it stands in 2026. Instruction-editing models like Flux Kontext and Qwen-Image-Edit have eaten most outpainting jobs - feed them the image with red padding and tell them to "remove the red" - and that's often the easier path now. But masked outpainting still owns one thing the edit models can't give you: the original pixels come back byte-for-byte. The KB's inpainting doc makes the case bluntly - if the original must survive untouched, or you're extending several times and can't afford drift, a mask-based pass is still the move. This node is the boring, reliable first step of that pass.
How it works
You supply left, top, right, and bottom padding amounts in pixels, and the node adds blank canvas around the image by those amounts. The step value on each input is 8, and that's deliberate: keeping your padded dimensions on multiples of 8 keeps them VAE-friendly for latent-space sampling. The second output is a mask with the newly-added border regions marked (white) and the original image area unmarked (black), so you can pipe it straight into a masked KSampler or into a MaskUnion if you're combining regions.
The inputs that matter
Five inputs, four of them the same shape:
image- the IMAGE you're extending.left,top,right,bottom- INTs from 0 to 8192, step 8, default 0. Pad any subset of sides; unset sides stay 0. Typical outpainting moves one or two sides at a time rather than all four, because the model does a better job extending "what's behind this edge" than inventing a full new border everywhere.
Outputs: the padded IMAGE, and the MASK covering the padded region. That mask is the thing that makes this node worth using - you get it for free instead of building it from the pad amounts yourself.
Installing it
Part of the EmAySee pack:
# ComfyUI Manager: search "ComfyUI_EmAySee_CustomNodes" and install
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes
Restart ComfyUI. No requirements.txt - image padding needs only torch and PIL internals already in ComfyUI.
Common issues
The pad-pixels-versus-multiple-of-8 relationship is the main thing to watch. The step is 8, so whatever you type gets snapped to a multiple of 8 in practice - 100 becomes 96 or 104 depending on how the widget rounds. If you're aiming for an exact final canvas size, compute your padding as the difference between target and current, then check the result. Also, padding with blank pixels means the sampler has no context at the seams - you'll often want to follow this node with an inpaint pass that starts from the original pixels (low denoise on the border) or a dedicated fill model, rather than a full-strength regenerate. And as the KB notes, if you're extending multiple times in a row, masked outpainting stays stable where a whole-frame edit model accumulates drift - that's exactly the workflow this node exists for.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| left | INT | 00–8192 | — |
| top | INT | 00–8192 | — |
| right | INT | 00–8192 | — |
| bottom | INT | 00–8192 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |