Nodes/ComfyUI_Element_easy/Image Pad & Blur
ComfyUI Node

Image Pad & Blur

Pad an image to any size with blurred edges that actually look intentional

By supElement·Created 9 months ago·Updated about 11 hours ago· 10
Image Pad & Blur
  • image
  • mask
  • image
  • mask
target_width0
target_height0
alignment
x_offset0
y_offset0
left0
top0
right0
bottom0
feathering50
content_blur0
pad_mode
background_color#000000

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_color fill (accepts hex like #000000 or RGB values), then feathering (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.

CategoryElement_easy/image

Inputs (15)

NameTypeDefaultDescription
imageIMAGE
target_widthINT00–8192
target_heightINT00–8192
alignmentCOMBO9 options: center, left, right, top, bottom, top-left, +3
x_offsetINT0-4096–4096
y_offsetINT0-4096–4096
leftINT00–4096
topINT00–4096
rightINT00–4096
bottomINT00–4096
featheringINT500–500
content_blurINT00–500
pad_modeCOMBO4 options: constant, edge, reflect, symmetric
background_colorSTRING#000000
maskoptMASK

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK