Nodes/ComfyUI-N-Nodes/Image Pad For Outpainting Advanced [πŸ…-πŸ…’πŸ…€πŸ…˜πŸ…£πŸ…”]
ComfyUI Node Runs on cloud

Image Pad For Outpainting Advanced [πŸ…-πŸ…’πŸ…€πŸ…˜πŸ…£πŸ…”]

Pad, feather, and color-match the border yourself

By Nuked88Β·Created 3 years agoΒ·Updated 2 years agoΒ· 237
Image Pad For Outpainting Advanced [πŸ…-πŸ…’πŸ…€πŸ…˜πŸ…£πŸ…”]
  • image
  • IMAGE
  • MASK
β—„left0β–Ί
β—„top0β–Ί
β—„right0β–Ί
β—„bottom0β–Ί
β—„feathering40β–Ί
β—„noise0.10β–Ί
β—„pixel_size8β–Ί
β—„pixel_to_copy32β–Ί
β—„temperature0β–Ί
β—„hue0β–Ί
β—„brightness0β–Ί
β—„contrast0β–Ί
β—„saturation0β–Ί
β—„gamma1.0β–Ί

Outpainting is really just inpainting with the mask turned inside out - you keep the real image and hand the model a blank border to fill in. The part that trips people up isn't the generation, it's the pad: a lazy solid-color extension gives your sampler nothing to anchor on, and you get a visible seam where the real photo stops and the AI guess starts. This node is Nuked88's answer to that specific problem - it's the padding step, done properly, before you ever touch a KSampler.

Instead of just extending the canvas with flat color, it builds the new border out of a pixelated, noise-blended copy of your image's actual edge pixels, so the model has texture and color continuity to work from rather than a blank wall. The color-correction part - the sliders for temperature, hue, brightness, and so on - was lifted from comfyui-art-venture by Sipherxyz, applied only to the padded region so you can pre-nudge the new area toward matching the original before generation even starts.

How it works

You give it pixel counts for how far to extend on each of the four sides. The node copies a strip of pixels from that edge of your source image (pixel_to_copy controls how many pixels deep), pixelates that strip at a block size you set (pixel_size), and blends it with random noise (noise) to fill the new border area. feathering softens the transition where the copied/noised border meets the mask edge, which is exactly the "generous overlap so the seam doesn't look pasted on" advice that applies to outpainting generally - this node just gives you sliders for it instead of leaving it to your masking skill.

The color-correction fields only touch the newly-padded area, not your original image - the idea being you can pre-shift the extension toward the lighting or color cast of the source before the model ever sees it, which can mean less denoising strength needed to blend the seam.

The inputs and outputs that matter

  • image - your source image.
  • left / top / right / bottom - how many pixels to extend on each side (0–4096, step 8, all default 0). Set the sides you actually want to grow; leave the rest at 0.
  • feathering (default 40) - softness of the blend at the mask boundary. Higher means a gentler transition.
  • noise (default 0.1, 0–1) - how much random noise gets mixed into the copied border versus a clean pixelated copy.
  • pixel_size (default 8, 8–64, step 8) and pixel_to_copy (default 32) - the block size of the pixelation effect and how deep a strip of source pixels it draws from.
  • temperature, hue, brightness, contrast, saturation, gamma - color correction, applied only to the padded/mask area.

Out the other side: IMAGE, the padded canvas ready for your sampler, and MASK, marking exactly which region is new - wire that straight into your KSampler's mask input or an inpaint-conditioning node.

Installing the pack

  • ComfyUI Manager - search "ComfyUI-N-Nodes," install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/Nuked88/ComfyUI-N-Nodes.git, then restart ComfyUI.

No models and nothing heavy to compile for this node - that requirement only ever applied to the pack's separate GPT/LLM nodes, and this is a pure image-processing node.

Common issues & troubleshooting

The seam is still visible after sampling. Push pixel_to_copy and feathering up before you touch anything else - a thin copy strip or a hard feather edge is the usual cause, the same failure mode as any outpaint with too little mask overlap on the original image. Community advice on plain masked outpainting converges on the same fix: generous overlap and a soft blur at the boundary matter more than denoising strength.

Color mismatch between the original and the new region. That's what the color-correction sliders are for - nudge temperature, brightness, or hue toward the original image's cast before sampling, rather than trying to fix it after the fact in post.

You only need one side extended and the others look untouched. That's expected - left/top/right/bottom default to 0, so any side you leave at 0 isn't padded at all. Only the sides you set actually grow.

Consider whether you need this node at all. For a quick one-off extension on a modern instruction-editing model (Flux Kontext/Klein-class checkpoints), the community trick that's largely replaced masked outpainting for casual use is simpler: pad with a flat color and just prompt the model to remove the padding and reveal what's behind it. This node earns its keep when you need the original pixels preserved byte-for-byte or you're doing several outpaint passes in a row, where the extra control over the seam actually matters.

Categoryimage

Inputs (15)

NameTypeDefaultDescription
imageIMAGEβ€”
leftINT00–4096β€”
topINT00–4096β€”
rightINT00–4096β€”
bottomINT00–4096β€”
featheringINT400–4096β€”
noiseFLOAT0.100–1β€”
pixel_sizeINT88–64β€”
pixel_to_copyINT320–4096β€”
temperatureFLOAT0-100–100β€”
hueFLOAT0-90–90β€”
brightnessFLOAT0-100–100β€”
contrastFLOAT0-100–100β€”
saturationFLOAT0-100–100β€”
gammaFLOAT1.00.2–2.2β€”

Outputs (2)

NameTypeDescription
IMAGEIMAGEβ€”
MASKMASKβ€”