Outpaint Config
Store your outpainting preferences once, hand them out everywhere
- mode
- gravity
- horizontal_percent
- vertical_percent
- left_px
- right_px
- top_px
- bottom_px
Outpainting has a configuration problem: how much to extend each side, and in which direction, is a decision you make once and then want applied consistently across every frame of a batch. Retyping "extend 20% horizontally, 10% vertically, anchor center" into a half-dozen nodes is how batches end up with inconsistent borders. OutpaintConfigNode is the pack's settings holder for exactly that - set it once, get all the values out as typed wires.
The inputs: mode (Percent or Pixels), gravity (nine choices - center, the four edges, and the four corners), horizontal_percent (default 20) and vertical_percent (default 10) for percentage-based padding, and left_px/right_px/top_px/bottom_px for pixel-based padding. The outputs are literally all of those, in the same names and types - mode and gravity as strings, the percents as floats, the px values as ints. Nothing is computed; it mirrors your settings into clean wires for the nodes that actually do math.
That math is OutpaintPaddingComputeNode's job: it takes this config (or any wires in the same shape) plus an image, and turns "20% horizontal, 10% vertical, gravity bottom" into exact pixel padding values. So the flow is: set preferences here once → feed them to the compute node → feed its pixel outputs to your padding/outpainting node. If you change your mind about how aggressive the outpaint should be, you edit one node and the whole branch follows.
Why percent + gravity? Because "extend the scene down" isn't the same as "add 200px to the bottom" - it depends on the image's actual size. Percent mode scales with the image; gravity decides which side the extension pushes out from, which matters for whether you're extending the ground, the sky, or both. If you're processing a folder of scans at wildly different resolutions, percent mode is the one that stays sane across the batch.
Install
Manager → search "PortraitUtils", or:
cd ComfyUI/custom_nodes
git clone https://github.com/heyburns/PortraitUtils
Restart. No extra dependencies - it's a config mirror.
Common issues
- Node outputs nothing useful - it's config, not an image node. Its outputs are strings/ints/floats; wire them into the compute node or a log.
- Percent mode behaves like pixels - check the
modeoutput actually saysPercent; if it's wired from a stale config the type might be wrong. - Gravity doesn't seem to do anything - gravity only matters once the compute node translates it into padding. If you're feeding px values directly downstream, gravity was never part of the calculation.
It's a thin node, but it's the difference between "tweak outpaint in one place" and "hunt for the same number in five nodes." For batch outpainting, that's worth having.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | Percent | 2 options: Percent, Pixels |
| gravity | COMBO | center | 9 options: center, left, right, top, bottom, top left, +3 |
| horizontal_percent | FLOAT | 20.00–10000 | — |
| vertical_percent | FLOAT | 10.00–10000 | — |
| left_px | INT | 00–1000000 | — |
| right_px | INT | 00–1000000 | — |
| top_px | INT | 00–1000000 | — |
| bottom_px | INT | 00–1000000 | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| mode | STRING | — |
| gravity | STRING | — |
| horizontal_percent | FLOAT | — |
| vertical_percent | FLOAT | — |
| left_px | INT | — |
| right_px | INT | — |
| top_px | INT | — |
| bottom_px | INT | — |