Nodes/WAS Node Suite v3/Image Pad for Outpaint
ComfyUI Node Runs on cloud

Image Pad for Outpaint

Outpaint padding and the mask that goes with it

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Image Pad for Outpaint
  • image
  • IMAGE
  • MASK
left0
top0
right0
bottom0
feathering40

Outpainting has a shape: put your picture on a bigger canvas, tell the sampler exactly where the new empty canvas is, and let it invent what belongs there. WAS Image Pad for Outpaint is the first half of that in one node - it does the padding and hands you the mask of everything that was added, so you don't have to build either by hand.

Feed it an image, then set how much new canvas to add on each side: left, top, right, bottom, each in pixels. That's the whole layout job. Two details worth knowing up front. Margins default to 0 and step by 8, and the tooltip is explicit why: multiples of 8 keep the padded size on a latent step, so the sampler and VAE don't choke on a weird dimension. And the added canvas is filled with mid grey at 0.5, not black or white - the neutral value a sampler is happiest painting over.

The padding alone is trivial; the mask is the actual product. The second output, MASK, is white over the added canvas and black over the original frame, with feathering pixels of fade at each seam. Wire that into Set Latent Noise Mask (or your inpaint conditioning node) and you've told the sampler: repaint the border region, leave the middle alone. feathering defaults to 40 - a 40px falloff that lets the new content blend into the old frame. Crank it up and the sampler repaints more of the original's edge, which buys you a smoother seam at the cost of touching pixels you might have wanted preserved. Set it to 0 only if you like visible stitch lines.

The node also draws the frame-in-canvas on itself - one scale, both sizes, the margins and the feather shown on the panel - so you read the numbers off the node instead of queuing a run to find out whether 256px right was enough. That's the WAS v3 "nodes that show their work" habit and it's genuinely the right call for a node whose whole job is geometry.

The classic workflow this feeds is the one the wider KB community has settled on for masked outpainting: original image stays the unmasked region, the extension is the mask, denoise high (0.8–1.0) because the extension is mostly new content, and prompt for what should appear there. The classic failure is a seam that reads as "pasted on" - the fix is generous mask feathering over the original's edge and a couple of passes with falling denoise, both of which this node's feathering input makes easy.

One caveat on how you use the outputs: the first output is the padded IMAGE itself, so you can also skip the noise-mask route entirely and run an instruction-model outpainting pass on the mid-grey canvas - the "pad with a colour, tell the model to remove the padding" trick that's become popular for instruction models. Either way, the node has done the bookkeeping.

Install

This is one of the 457 nodes in WAS Node Suite v3. ComfyUI Manager - search "WAS Node Suite" - or:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui

Restart after. Needs ComfyUI 0.14.0+ and Python 3.10+. No pip packages, no model downloads for this one. The suite's v2-era install pain (a dozen pinned dependencies that broke on ComfyUI updates) is gone in v3 - it installs clean.

Common issues

  • Odd-sized latent or a silent refusal to sample. You padded to a size that isn't a multiple of 8. Use the step in the widgets and you're fine.
  • Hard seam where the canvas meets the frame. Raise feathering, or run a second pass at lower denoise.
  • The original frame got repainted more than you wanted. feathering is doing its job a little too well - drop it toward 20–30.
CategoryWAS Suite/Image/Process

Inputs (6)

NameTypeDefaultDescription
imageIMAGEThe picture to set on the larger canvas. A batch is padded frame by frame by the same margins and comes back the same length.
leftINT00–16384Pixels of new canvas added on the left; INT. 0 adds none, 256 adds a quarter of a 1024 wide frame. Multiples of 8 keep the padded size on a latent step.
topINT00–16384Pixels of new canvas added above; INT. 0 adds none, 256 adds a quarter of a 1024 tall frame. Multiples of 8 keep the padded size on a latent step.
rightINT00–16384Pixels of new canvas added on the right; INT. 0 adds none, 256 adds a quarter of a 1024 wide frame. Multiples of 8 keep the padded size on a latent step.
bottomINT00–16384Pixels of new canvas added below; INT. 0 adds none, 256 adds a quarter of a 1024 tall frame. Multiples of 8 keep the padded size on a latent step.
featheringINT400–16384Pixels the mask fades over on the inside of each seam; INT. 0 = a hard edge, 40 = a 40px falloff that lets a sampler blend the new canvas into the frame, 128 = a wide blend that repaints more of the original. Ignored where twice this reaches across the frame.

Outputs (2)

NameTypeDescription
IMAGEIMAGEThe frame sitting on the larger canvas, every added margin filled with mid grey at 0.5 for a sampler to paint over.
MASKMASKWhite over the added canvas and black over the frame, fading in over feathering pixels at each seam. One plane whatever the batch length, since every frame is padded alike. Wire it into Set Latent Noise Mask or an inpaint conditioning node.