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

 JLC Padded Latent

Outpaint without the tape measure

By Damkohler·Created 6 months ago·Updated 2 days ago· 24
 JLC Padded Latent
  • positive
  • negative
  • vae
  • image
  • mask
  • positive
  • negative
  • latent
  • mask
  • width
  • height
  • padded_image
  • padded?
scaleFac0.50
maxCanvas1152
newAspectRat3:4
offsetX0.50
offsetY0.50
feathering8
seamFixPx8
noise_masktrue

Extending an image beyond its edges used to mean a pile of nodes: pad the canvas here, compute the mask there, encode with the VAE, then separately wire up inpaint conditioning and hope the coordinates line up. JLC Padded Latent collapses that whole chain into one node. It takes your image, places it on a new canvas at whatever aspect ratio you want, builds the editable mask for the padded regions, VAE-encodes the result, attaches the inpaint-conditioning fields, and hands you a ready-to-sample latent.

It's the "integrated" option in JLC's padded pair - the sibling JLC Padded Image only does the canvas-and-mask prep and leaves encoding and conditioning to you. Padded Latent does the lot in one go, which is exactly right when outpainting or padded inpainting is the workflow.

How it works

Under the hood it runs the same padding logic as JLC Padded Image, then adds three things: VAE encoding, the standard ComfyUI inpaint-conditioning fields (concat_latent_image, concat_mask, and optionally noise_mask), and a unified mask output. The flow is: scale your image onto the target canvas → generate a mask marking the new/editable regions → union in any manual mask → encode → attach conditioning.

The parameters you'll actually touch:

  • newAspectRat - the target canvas ratio in standard width:height notation (16:9 wide, 3:4 portrait, etc.). Pick a ratio, not a resolution.
  • maxCanvas - the biggest canvas dimension (default 1152, up to 8192). Output dimensions round down to multiples of 8 so they stay latent-friendly.
  • scaleFac (0.1–1.0) - how much of the canvas your original occupies. This is the outpainting dial: lower it and the empty space around the image becomes the editable region.
  • offsetX / offsetY (0–1) - where the image sits. 0.5/0.5 centers it; 0/0 pins it top-left so the growth happens mostly right and below.
  • feathering - softens the mask edge between preserved and editable regions (4–12 is the usual band).
  • seamFixPx - grows the editable region slightly to repaint the seam band, reducing visible borders in noise-mask workflows.
  • noise_mask - attach the mask to the latent so sampling concentrates inside it. The author's tooltip says it plainly: may help or hurt depending on model and workflow, so this is a try-both toggle.
  • mask (optional) - a manual mask that gets aligned to the scaled image, unioned with the generated padding mask. Lets one workflow outpaint the canvas and edit a region inside the original.

The outputs are the useful story: positive and negative conditioning (already inpaint-conditioned), latent, the unified mask, width / height, a padded_image for eyeballing the canvas, and a padded? boolean so downstream logic can tell whether padding actually happened.

Installing it

Ships in jlc-comfyui-nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Damkohler/jlc-comfyui-nodes.git

Restart ComfyUI, or install "jlc-comfyui-nodes" from ComfyUI Manager. No Python dependencies. The VAE you wire in is the usual checkpoint VAE.

Where people get burned

  • Don't double up on inpaint conditioning. The pack's own docs warn about this explicitly: if you stack Padded Latent with another node that adds the same conditioning fields, you get duplicated (and possibly broken) metadata. Let this node be the only one doing that job.
  • noise_mask isn't free. It usually focuses sampling inside the mask, but some models do better with it off. If your outpainted region comes back stale or weird, flip it and re-run.
  • Outpainting needs a small scaleFac. Leave it at 1.0 and there's no room to extend; drop to ~0.7 and pick a wider newAspectRat for a side expansion.
  • Watch for seams on multi-pass work. A bigger seamFixPx and a bit of feathering are the classic seam killers, and remember to composite back rather than letting repeated decode/encode cycles degrade the whole frame.

Honest framing: masked inpainting's share of the conversation shrank as instruction-editing models took over object fixes, but outpainting to a fixed target aspect ratio is still a job the mask route does cleanly - and Padded Latent makes it a two-minute setup instead of a node archaeology project.

Categoryconditioning/inpaint

Inputs (13)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
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
noise_maskBOOLEANtrueAttach noise_mask to the latent so sampling happens primarily inside the mask. May help or hurt depending on model/workflow.
maskoptMASK

Outputs (8)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
latentLATENT
maskMASK
widthINT
heightINT
padded_imageIMAGE
padded?BOOLEAN