Donut Inpaint · Keep Surroundings:
DonutInpaintComposite combines an edited image with the original image so changes remain inside a selected area while the rest stays as it was. This is useful after steps such as upscaling or Face Detailer, which may otherwise alter parts of the picture you intended to preserve. The transition follows a mask: fully selected areas show the edited result, unselected areas show the original, and partially selected edges blend the two. When selected-area editing is off, the node passes the edited image through unchanged.
Donut Inpaint · Keep Surroundings Input Parameters:
image
The required IMAGE to use as the edited result. Its dimensions determine the size of the final image. Where the selection mask is fully active, this image appears in the result; where the mask is inactive, the original image stored in the inpaint data appears instead. No minimum, maximum, default value, or selectable options are specified for this input.
inpaint
An optional DONUT_INPAINT connection that supplies the original image and selection mask used for compositing. The mask controls which parts of image remain visible: a value of 1 keeps the edited image, a value of 0 restores the original, and values between them blend both images. If the supplied original image or mask has different dimensions from image, the node resizes it to match before combining them. When this input is unconnected, its default is None and image passes through unchanged. No numeric minimum, maximum, or selectable options are specified for this input.
Donut Inpaint · Keep Surroundings Output Parameters:
image
The single IMAGE output. With inpaint connected, it contains the composite: the edited result inside the selection, the original image outside it, and a blend along partially selected edges. Its dimensions match the input image. Without inpaint, it is the input image passed through unchanged. Connect this output to your next editing, preview, or saving step.
Donut Inpaint · Keep Surroundings Usage Tips:
- Place the node after an edit, upscale, or Face Detailer step when you want changes from that step to appear only within the Edit Studio selection.
- Connect the processed result to
imageand the corresponding selection data toinpaint. Using selection data from the same source image helps keep restored areas aligned with the edit. - Leave
inpaintunconnected when selected-area editing is off; the node will passimagethrough without compositing. - Inspect the selection edge in a preview. Partially selected mask areas blend the original and edited images, so a soft edge creates a gradual transition.
- Check the result carefully when the original image and processed image have different dimensions. The node resizes the original and mask automatically, but that cannot correct a selection that points to the wrong part of the image.
Donut Inpaint · Keep Surroundings Common Errors and Solutions:
KeyError: 'image'
- Explanation: The connected inpaint data does not contain the original image that the node expects. This is a possible error for malformed data, not a message defined by the node itself.
- Solution: Connect a compatible
DONUT_INPAINToutput that includes the original image, or leaveinpaintunconnected if you do not need selected-area compositing.
KeyError: 'mask'
- Explanation: The connected inpaint data does not contain the selection mask needed to decide where to show the edit. This is a possible error for malformed data, not a message defined by the node itself.
- Solution: Reconnect or regenerate the selection data with a compatible node that supplies a mask.
TypeError: '...' object is not subscriptable
- Explanation: The value connected to
inpaintmay not be the expected data structure containingimageandmask. The exact message depends on the value supplied. - Solution: Check that the connection comes from a compatible
DONUT_INPAINToutput rather than an ordinary image or mask output.
AttributeError: '...' object has no attribute 'to'
- Explanation: An image or mask inside the inpaint data is not a tensor in the form this node expects. The exact message depends on the unexpected value.
- Solution: Use a compatible node to produce the inpaint data; avoid manually substituting image files, lists, or other values for its internal image and mask.
RuntimeError: The size of tensor ... must match the size of tensor ...
- Explanation: The image, original image, or mask may have incompatible shapes that automatic resizing cannot resolve, such as mismatched batches. The exact wording depends on the mismatch.
- Solution: Use matching image and selection data from the same workflow, and check that upstream nodes produce compatible image batches.
