For ComfyUI outpainting, use both outputs of Pad Image for Outpainting according to the input paths defined by your target inpainting workflow: its padded image provides the expanded canvas, and its mask marks the extension area. Find inputs that accept the corresponding data types and have the intended roles; do not assume fixed node names or a universal sampler connection. Set the four padding values to define the new canvas, then assess feathering separately as a boundary-transition control. The official tutorial presents an example inpainting workflow, but does not prescribe a universal downstream port layout.
Calculate the canvas before connecting nodes
If the source image is W × H, the padded dimensions are W + left + right by H + top + bottom. These values describe added pixels on each edge, not the total target dimensions. For a hypothetical 1200 × 800 image with left=160, top=80, right=240, and bottom=120, the padded canvas is 1600 × 1000.
Decide which edges need generated content and enter a value for each side. Use zero on an edge that should not grow. This calculation gives you a concrete check against the output image dimensions and helps catch a swapped or mistyped side value. The node documentation lists all four padding inputs and describes the image output as the padded image. (Node documentation)
Wire the image and mask by role
- Connect the source image to
Pad Image for Outpainting'simageinput. - Set
left,top,right, andbottomto the pixel amounts calculated for the intended composition. Setfeatheringas a separate parameter; do not add it to the canvas-size calculation. - In the target inpainting workflow, identify the input path intended to receive the expanded canvas and accepting
IMAGE; connect the node's `image` output there. Use the padded result when that workflow's definition calls for the expanded canvas. Do not infer a universal sampler port from this description. - Identify the workflow's input path intended to receive the outpainting mask and accepting
MASK; connect the node's `mask` output there. If the workflow does not expose a compatible path, consult its definition or documentation rather than guessing or substituting the image output. Keep the workflow's model and other conditioning connections intact. - Check the workflow's previews and input connections before queuing generation. The supplied tutorial uses an inpainting model and explains that this is an inpainting process with a mask made by the padding node. (Official outpainting tutorial)
The exact downstream sockets depend on the inpainting workflow. The documentation supports the roles of the two outputs, but it does not establish that every sampler or inpainting graph uses identically named inputs. Match the mask to the workflow's mask path and the padded image to its image path.
Inspect the mask before judging the generated result
The mask is what directs the workflow toward the added region; the padded image provides the canvas on which that region is generated. A wrong connection can therefore look like a geometry problem, a missing extension, or an unexpected change to the existing picture. Preview both outputs where your graph allows it. Confirm that the image has the intended new dimensions and that the mask marks the area to be extended.
Treat the mask preview as a routing check, not a promise about which pixels will remain perfectly unchanged. The official material says the mask indicates original and added areas, and the tutorial describes it as marking extension areas. It does not specify a universal mask polarity or guarantee pixel-perfect preservation for every downstream model and workflow. If the mask appears inverted or the wrong region is targeted, check the inpainting workflow's mask handling rather than compensating by changing the padding values blindly.
Use feathering as a separate boundary control
feathering controls the smoothness of the transition between the original image and the padded area. It does not change the formula for canvas width or height. Evaluate it at the join: inspect whether the generated edge blends acceptably and whether detail from the original image appears to be affected more than the job allows. The documentation describes higher feathering values as creating smoother transitions, but does not promise a particular result for a given value or image.
A practical adjustment is to keep the padding fixed while comparing the current feathering value with a changed value. If the transition is visibly abrupt, try a different value and inspect again. If the original region is not being handled as intended, first verify the mask and downstream inpainting connections; changing feathering is not a substitute for correcting a miswired mask.
Acceptance checks and recovery paths
The following figures are a hypothetical check, not a measured ComfyUI result. For the 1200 × 800 source and the four padding amounts above, an acceptable padded-image preview should measure 1600 × 1000. The mask preview should target the added borders, and a sample near the join should be reviewed for the chosen transition. Save or inspect the final output dimensions as part of the same check.
| Check | Hypothetical observation | If it fails |
|---|---|---|
| Canvas size | Preview is 1600 × 1000 | Recalculate each side; check for a missing or swapped padding value. |
| Mask target | Added borders are marked for generation | Check that the mask output reaches the inpainting mask path and how that workflow interprets it. |
| Original-area boundary | The join has no obvious unwanted discontinuity | Compare feathering separately; if the wrong area changes, inspect mask routing first. |
| Final output | Dimensions match the intended padded canvas | Check that the padded image, not the source, enters the inpainting workflow and review later graph nodes. |
If the output has the original dimensions, trace the image connection from the padding node to the inpainting input. If the dimensions are right but the wrong region is affected, trace the mask connection and inspect the mask preview. If the area is right but the join looks poor, adjust feathering and assess again without changing the four padding amounts. These checks diagnose routing and boundary setup; they cannot guarantee that a model will invent a particular detail or preserve every original pixel exactly.
Common questions
Should the mask go to the sampler directly?
Use the mask input path defined by your inpainting workflow. The official documentation establishes that the node outputs a MASK for guiding outpainting, but does not specify one universal connection to a particular sampler node. Do not guess based on socket position or name alone.
Does feathering add pixels to the canvas?
No. Canvas dimensions are determined by the source dimensions plus the four padding amounts. Feathering is documented as controlling transition smoothness, not canvas size.
If the output dimensions are right but the wrong area changed, what should I check first?
First inspect the node's mask preview to see whether it marks the intended extension area. Then trace the MASK output into the target workflow and check that workflow's definition for how it interprets the mask. Do not change the padding amounts to compensate for a mask-routing or interpretation problem.
Sources and next step
- ImagePadForOutpaint - ComfyUI Built-in Node Documentation
- Outpainting in ComfyUI: Extend an Image Beyond Its Borders
This guide interprets public documentation and uses explicitly hypothetical acceptance examples, not application tests. Controls and availability can change; verify the cited manual against your installed version.
For work created in Imagild, carry the input requirements and acceptance checklist into the photo editor. The external software controls discussed above belong to their respective products.