Image Pad & Blur
Pad an image to any size with blurred edges that actually look intentional
- image
- mask
- image
- mask
Image Pad & Blur solves the "my image doesn't fit the canvas" problem in the way that actually looks good. Instead of stretching the image or leaving hard black bars, it pads the edges by extending and blurring the image's own content - the classic blurred-background treatment you see on vertical video and widescreen crops. It's the difference between a video that looks cropped and one that looks produced.
How it works
You've got two ways to drive it, and they overlap. The straightforward way is target_width and target_height: give it the canvas size you want and it figures out how much padding each side needs. The finer-grained way is the left/top/right/bottom inputs - explicit per-side padding amounts, for when you want asymmetric edges or need to match a specific region.
The pad_mode enum is where the visual character comes from:
- constant - solid
background_colorfill (accepts hex like#000000or RGB values), thenfeathering(0–500) blurs how the image content blends into that color. This is your clean, flat look. - edge / reflect / symmetric - extend the image's own pixels past its borders. Edge clamps the outermost pixels, reflect and symmetric mirror them back (the README notes two of these behave near-identically). Use these when you want the pad to be an extension of the photo, not a flat color.
Two blur knobs work in constant mode: feathering controls the overall softness of the blend into the background, and content_blur controls how much the extended region of the image itself is blurred. Crank content_blur and the reflected edges become a smooth dreamy backdrop; leave it at 0 and you get a crisp mirror.
Then alignment (nine positions: center, left, right, top, bottom, corners) places the original image within the padded canvas, and x_offset/y_offset let you nudge it. There's an optional mask input, and both a padded image and a padded mask come out - so if you're padding for an inpaint/outpaint pass, the mask scales along with the image and stays aligned.
The clip-mode detail worth knowing
If target_width or target_height is smaller than the source image, the node flips into a clip mode instead of padding - it crops the image down to the target. In that case alignment still applies (so you can clip from center, or from a corner), and the README calls this out specifically as the mode where alignment really matters. Set one dimension larger and one smaller and you've got a one-node crop-and-pad.
Installing it
It's in supElement/ComfyUI_Element_easy:
cd ComfyUI/custom_nodes
git clone https://github.com/supElement/ComfyUI_Element_easy.git
Restart ComfyUI, or install via ComfyUI Manager by searching ComfyUI_Element_easy.
Gotchas
The two big ones: (1) background_color only does anything in constant mode - set a hex value, watch it do nothing, and you're probably in edge/reflect mode. (2) In clip mode, remember you're cropping, and the crop is governed by alignment and offsets, so if content vanishes off-screen, that's the alignment working as asked. Start with feathering low (like 30–50) - too high and the blend zone swallows the image edges.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| target_width | INT | 00–8192 | — |
| target_height | INT | 00–8192 | — |
| alignment | COMBO | 9 options: center, left, right, top, bottom, top-left, +3 | |
| x_offset | INT | 0-4096–4096 | — |
| y_offset | INT | 0-4096–4096 | — |
| left | INT | 00–4096 | — |
| top | INT | 00–4096 | — |
| right | INT | 00–4096 | — |
| bottom | INT | 00–4096 | — |
| feathering | INT | 500–500 | — |
| content_blur | INT | 00–500 | — |
| pad_mode | COMBO | 4 options: constant, edge, reflect, symmetric | |
| background_color | STRING | #000000 | — |
| maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |