JLC Padded Latent
Outpaint without the tape measure
- positive
- negative
- vae
- image
- mask
- positive
- negative
- latent
- mask
- width
- height
- padded_image
- padded?
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:heightnotation (16:9wide,3:4portrait, 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.5centers it;0/0pins 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_maskisn'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 widernewAspectRatfor a side expansion. - Watch for seams on multi-pass work. A bigger
seamFixPxand 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.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| vae | VAE | — | |
| image | IMAGE | — | |
| scaleFac | FLOAT | 0.500.1–1 | — |
| maxCanvas | INT | 1152512–8192 | — |
| newAspectRat | COMBO | 3:4 | Target canvas aspect ratio in standard width:height notation. Example: 16:9 means width 16, height 9. |
| offsetX | FLOAT | 0.500–1 | — |
| offsetY | FLOAT | 0.500–1 | — |
| feathering | INT | 80–256 | — |
| seamFixPx | INT | 80–64 | — |
| noise_mask | BOOLEAN | true | Attach noise_mask to the latent so sampling happens primarily inside the mask. May help or hurt depending on model/workflow. |
| maskopt | MASK | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |
| latent | LATENT | — |
| mask | MASK | — |
| width | INT | — |
| height | INT | — |
| padded_image | IMAGE | — |
| padded? | BOOLEAN | — |