ComfyUI Easy Padding
Add a border, get an outpainting mask for free
- image
- IMAGE
- MASK
Adds padding around an image. Sounds trivial, and the border part is - but this node also spits out a mask covering exactly the padding you added, and that's the part that makes it quietly useful. A padded image plus a mask of the new area is an outpainting setup, ready to go.
The two things it's good for
Framing. You want a solid border around an image - a white mat for a print layout, a colored frame, some breathing room. Set the pixels on each side, pick a color, done.
Outpainting. This is the better reason. Extending an image beyond its edges - "outpainting" - needs two things: a bigger canvas with empty space, and a mask telling the model which part is empty and needs filling. This node produces both in one shot. Pad the canvas out, feed the padded image and the mask into your inpaint/fill workflow, and the model paints new scenery into the border. It's the same trick people do with dedicated crop-and-stitch or fill nodes, just packaged as a single padding step.
The inputs
- image - what you're padding.
- left / top / right / bottom - how many pixels to add on each side, independently (0–4096). Uneven values are fine, so you can extend just to the left, or more on top than bottom.
- color - the fill color as a hex string, default
#ffffff(white). - transparent - a boolean; flip it on and the padding is transparent instead of colored. For outpainting you generally don't care about the color since the model repaints it anyway, but transparency matters if you're compositing.
Outputs are the padded IMAGE and a MASK marking the added region.
Using it for outpainting
Pad the sides you want to extend. Take the MASK output - that's your "fill this" region - and the padded IMAGE, and route them into your inpainting or Flux Fill setup. The model treats the original image as fixed context and generates into the mask. Give it a bit of prompt describing what should be out there, or it'll invent something to fill the space. Modern edit models handle outpainting cleanly, so this pairs nicely with them.
Watch for
Padding a lot at once (huge borders) asks the model to hallucinate a lot of new content with little context, and the further out it goes the more it drifts. Extend in reasonable steps rather than quadrupling the canvas in one pass. Otherwise this is about as low-risk as a node gets.
Installing ComfyUI-Addoor
ComfyUI Manager: Install Custom Nodes → search "ComfyUI-Addoor" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Eagle-CN/ComfyUI-Addoor.git
cd ComfyUI-Addoor
pip install -r requirements.txt
Restart and find it under 🌻 Addoor / image. Even if you never outpaint, keep it around - "add a clean border and know exactly where it is" comes up more than you'd think.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| left | INT | 00–4096 | — |
| top | INT | 00–4096 | — |
| right | INT | 00–4096 | — |
| bottom | INT | 00–4096 | — |
| color | STRING | #ffffff | — |
| transparent | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |