Inpainting, Outpainting, and Bounding Box

Modified on Tue, 24 Sep at 8:56 AM

Inpainting

Overview

Inpainting, in the context of image generation, is a process where we try to fill in parts of an image with new or modified content.

In a technical sense, inpainting methods use the available information in an image (such as edges, textures, colors) to predict what the incomplete areas should look like, and then uses the selected model to regenerate that portion of the image. Invoke performs additional generation techniques, controllable through the Compositing tab, to blend the new content in with your existing image.


Inpainting in Invoke

To select an area for Inpainting, you will use the Inpaint Mask layer. Inpaint masks have their own dedicated dedicated layer in the ‘Layers’ tab of the Layers & Gallery panel, and you can utilize multiple inpaint masks at the same time.

To add an inpaint mask, go to the ‘Layers’ tab, click the ‘Add Layer’ button, and select ‘Inpaint Mask.’ Then choose the tool you’d like to use from the toolbar, whether it’s the brush tool or rectangle tool, to create the mask selection.


The area you paint is the part of the image you want to regenerate when you press ‘Invoke.’ Using the visible Raster Layer data inside of the selected region, the model will regenerate the portion of the image within the bounding box, keeping unmasked areas the same throughout the process to guide the generation.

There’s now much more flexibility with inpaint masks. You can hide them from view, disable them temporarily, move them around the canvas, and even transform them—scaling them larger or smaller as needed.

For higher quality images, we recommend adjusting the bounding box to the smallest region that matches your prompt while inpainting, as Invoke will generate additional details with a smaller bounding box.


Note: Inpainting is significantly impacted by the model you have selected. Certain models designed specifically for Inpainting will operate differently than as noted above — refer to the model information provided by creators for additional information on these specialized models. In general, we do not recommend these models for most creative tasks.


Outpainting

Overview

Outpainting, also referred to as image extrapolation, involves generating new content that extends beyond the edges of a given image.

Consider the scenario where an image captures only a segment of a larger scene, such as a beach. Through outpainting, one can potentially enlarge the image to reveal more of the surroundings, including the broader landscape, ocean, or horizon. This process uses many of the same techniques.


Outpainting in Invoke

You can outpaint by expanding the Bounding Box and extending the box to capture an area that you would like to have generated. Transparent areas of the image will use nearby colors to make assumptions about what should be generated. If you’re expecting new areas to have dramatically different content, you’ll find improved results by creating some general colors/shapes using a raster layer, and including that as an inpainting mask.


There are a few short-cuts to help you manage the bounding box. To start, select the image you want to outpaint, drag it into the canvas, and select ‘Create Raster Layer.’ Then press the ‘C’ hotkey or click the bounding box button to adjust the bounding box to the area you want to expand.

Once your bounding box is set, press the ‘Invoke’ button. Make sure ‘Send to Canvas’ mode is selected next to the Invoke button—this will stage everything in the canvas. When you’re satisfied with the final image, click the ‘Accept’ button to merge it into the canvas. Then use the ‘Save Canvas to Gallery’ option to save your final image.

You’ll typically want high denoising strength settings — Above .6 — To ensure that there’s enough transformation occurring to guide the generation process.


Note: Generally, it’s advisable to only outpaint with about ~25% of the image transparent in the area currently selected by the bounding box, and to keep your bounding box at the optimal size for your selected model.


Bounding Box

Adjusting the Bounding Box

To start adjusting the bounding box, press the ‘C’ hotkey to select the bounding box. You can drag from the corners or the middle of the bounding box to expand or contract it. For more precise control, hold the command key while dragging.

You can automatically fit the bounding box to your layers but clicking the Fit Bbox to Layers button, and you can transform your image to fit your bounding box by using the Transform function, and choosing “fit layers to bounding box”.

To move the bounding box, click anywhere inside the box and drag it to your desired position.


Using your Bounding Box selection

After adjusting your bounding box to fit around the desired part of you image, you can access a variety of controls by right clicking on the bounding box area.

Clicking ‘Save Bbox to Gallery’ will save the selected portion of an image as a new image in the Gallery.

Additionally, you can create layers directly from your selection by selecting the desired layer type from the ‘Create from Bbox’ sub-section of the menu. The selected layer will appear in the ‘Layers’ tab.


-----


You can learn more about other features of the Control Canvas here.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article