Nodes/jlc-comfyui-nodes/ JLC Padded Image
ComfyUI Node

 JLC Padded Image

The Inpaint/Outpaint Canvas Builder People Actually Share

By Damkohler·Created 6 months ago·Updated 3 days ago· 24
 JLC Padded Image
  • image
  • mask
  • Padded Image
  • Mask
  • Width
  • Height
  • Padded?
scaleFac0.50
maxCanvas1152
newAspectRat3:4
offsetX0.50
offsetY0.50
feathering8
seamFixPx8

This is the breakout node of the JLC pack - the one people actually post workflows about. You can tell it's a hit because the pack's author isn't the only one sharing it: community posts introducing "JLC Padded Image" for inpaint/outpaint workflows picked up real traction, which is rare for a canvas-prep utility. Its job is small and specific: take an image, place a scaled version of it on a new canvas at whatever aspect ratio you want, and hand you back an aligned editable mask. Everything else - the VAE encode, the conditioning - is your business.

Why you'd reach for it

Mask-based inpainting and outpainting still own two things the new edit models don't: bit-identical unmasked pixels (you composite the masked region back and nothing else in the frame moved), and the denoise dial, a continuous 0–1 control rather than a yes/no instruction. Outpainting is the case this node makes easy: set scaleFac below 1, pick a wider canvas ratio, and the new canvas area automatically becomes the editable mask region. Combined with a manual mask, one pass can outpaint the canvas and edit a region inside the original image.

How it works

The node converts your image to PIL, scales it (LANCZOS) to fit the target canvas at scaleFac, and places it at offsetX/offsetY. Then it builds the mask: white = paint, black = keep. feathering softens the boundary between the preserved image and the editable region (default 8px - right in the 4–12px sweet spot people actually use), and seamFixPx grows the white region slightly so the bilinear transition band near the image border gets repainted instead of leaving a line. An optional manual mask input gets aligned to the scaled image position and merged with the padding mask. Output dimensions are rounded down to multiples of eight so they stay latent-grid friendly.

The inputs that matter

  • newAspectRat - target canvas ratio, standard width:height labels: 16:9 wide, 9:16 tall, 3:4 portrait, and six more.
  • scaleFac - how much of the canvas the original occupies. Lower = more room to outpaint.
  • offsetX / offsetY - placement: 0.5 centers, 0.0/1.0 push the image to an edge.
  • feathering, seamFixPx - the two knobs that decide whether your inpaint edge blends or shows.

Outputs are Padded Image, Mask, Width, Height, and a Padded? boolean that flips false when the image already fills the canvas with nothing to edit.

The ratio gotcha

Early versions of this node had a confusing quirk where the aspect-ratio dropdown felt inverted - pick 4:3 and get a 3:4 canvas. That got fixed; current code treats the labels as standard width:height, so 16:9 means wide. If you load an old workflow and the canvas comes out rotated, that's a stale version - update the pack.

Wiring it up and installing

Feed Padded Image and Mask into a VAE encode plus your favorite inpaint-conditioning setup (the same pack's JLC Padded Latent bundles that conditioning for you if you'd rather not build it), then a sampler with a reasonable denoise - 0.6–0.8 for outpainting new area, lower for detail fixes.

# ComfyUI Manager:  Install Custom Nodes → search "JLC ComfyUI Nodes"
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Damkohler/jlc-comfyui-nodes.git

Restart after installing. No extra Python packages, no model downloads - just a small utility node in a small pack. If your mask comes out with harsh edges, raise feathering; if you see a seam line where the original image meets the new canvas, raise seamFixPx.

Categoryimage

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
scaleFacFLOAT0.500.1–1
maxCanvasINT1152512–8192
newAspectRatCOMBO3:4Target canvas aspect ratio in standard width:height notation. Example: 16:9 means width 16, height 9.
offsetXFLOAT0.500–1
offsetYFLOAT0.500–1
featheringINT80–256
seamFixPxINT80–64
maskoptMASK

Outputs (5)

NameTypeDescription
Padded ImageIMAGE
MaskMASK
WidthINT
HeightINT
Padded?BOOLEAN