invokeAI-docs

The Unified Canvas is a tool designed to streamline and simplify the process of composing an image using Stable Diffusion. It offers artists all of the available Stable Diffusion generation modes (Text To Image, Image To Image, Inpainting, and Outpainting) as a single unified workflow. The flexibility of the tool allows you to tweak and edit image generations, extend images beyond their initial size, and to create new content in a freeform way both inside and outside of existing images.

This document explains the basics of using the Unified Canvas, introducing you to its features and tools one by one. It also describes some of the more advanced tools available to power users of the Canvas.

Basics

The Unified Canvas consists of two layers: the Base Layer and the Mask Layer. You can swap from one layer to the other by selecting the layer you want in the drop-down menu on the top left corner of the Unified Canvas, or by pressing the (Q) hotkey.

Base Layer

The Base Layer is the image content currently managed by the Canvas, and can be exported at any time to the gallery by using the Save to Gallery option. When the Base Layer is selected, the Brush (B) and Eraser (E) tools will directly manipulate the base layer. Any images uploaded to the Canvas, or sent to the Unified Canvas from the gallery, will clear out all existing content and set the Base layer to the new image.

Staging Area

When you generate images, they will display in the Canvas’s Staging Area, alongside the Staging Area toolbar buttons. While the Staging Area is active, you cannot interact with the Canvas itself.

![staging area](../assets/canvas/staging_area.png)

Accepting generations will commit the new generation to the Base Layer. You can review all generated images using the Prev/Next arrows, save any individual generations to your gallery (without committing to the Base layer) or discard generations. While you can Undo a discard in an individual Canvas session, any generations that are not saved will be lost when the Canvas resets.

Mask Layer

The Mask Layer consists of any masked sections that have been created to inform Inpainting generations. You can paint a new mask, or edit an existing mask, using the Brush tool and the Eraser with the Mask layer set as your Active layer. Any masked areas will only affect generation inside of the current bounding box.

Bounding Box

When generating a new image, Invoke will process and apply new images within the area denoted by the Bounding Box. The Width & Height settings of the Bounding Box, as well as its location within the Unified Canvas and pixels or empty space that it encloses, determine how new invocations are generated - see Inpainting & Outpainting below. The Bounding Box can be moved and resized using the Move (V) tool. It can also be resized using the Bounding Box options in the Options Panel. By using these controls you can generate larger or smaller images, control which sections of the image are being processed, as well as control Bounding Box tools like the Bounding Box fill/erase.

Inpainting & Outpainting

“Inpainting” means asking the AI to refine part of an image while leaving the rest alone. For example, updating a portrait of your grandmother to have her wear a biker’s jacket.

masked original inpaint result
granny with a mask applied just like magic, granny with a biker's jacket

“Outpainting” means asking the AI to expand the original image beyond its original borders, making a bigger image that’s still based on the original. For example, extending the above image of your Grandmother in a biker’s jacket to include her wearing jeans (and while we’re at it, a motorcycle!)

![more magic - granny with a tattooed arm, denim pants, and an obscured motorcycle](../assets/canvas/biker_granny.png)

When you are using the Unified Canvas, Invoke decides automatically whether to do Inpainting, Outpainting, ImageToImage, or TextToImage by looking inside the area enclosed by the Bounding Box. It chooses the appropriate type of generation based on whether the Bounding Box contains empty (transparent) areas on the Base layer, or whether it contains colored areas from previous generations (or from painted brushstrokes) on the Base layer, and/or whether the Mask layer contains any brushstrokes. See Generation Methods below for more information.

Getting Started

To get started with the Unified Canvas, you will want to generate a new base layer using Txt2Img or importing an initial image. We’ll refer to either of these methods as the “initial image” in the below guide.

From there, you can consider the following techniques to augment your image:

Generation Methods

The Canvas can use all generation methods available (Txt2Img, Img2Img, Inpainting, and Outpainting), and these will be automatically selected and used based on the current selection area within the Bounding Box.

Text to Image

If the Bounding Box is placed over an area of Canvas with an empty Base Layer, invoking a new image will use TextToImage. This generates an entirely new image based on your prompt.

Image to Image

If the Bounding Box is placed over an area of Canvas with an existing Base Layer area with no transparent pixels or masks, invoking a new image will use ImageToImage. This uses the image within the bounding box and your prompt to interpret a new image. The image will be closer to your original image at lower Image to Image strengths.

Inpainting

If the Bounding Box is placed over an area of Canvas with an existing Base Layer and any pixels selected using the Mask layer, invoking a new image will use Inpainting. Inpainting uses the existing colors/forms in the masked area in order to generate a new image for the masked area only. The unmasked portion of the image will remain the same. Image to Image strength applies to the inpainted area.

If you desire something completely different from the original image in your new generation (i.e., if you want Invoke to ignore existing colors/forms), consider toggling the Inpaint Replace setting on, and use high values for both Inpaint Replace and Image To Image Strength.

!!! note

By default, the **Scale Before Processing** option — which
inpaints more coherent details by generating at a larger resolution and then
scaling — is only activated when the Bounding Box is relatively small.
To get the best inpainting results you should therefore resize your Bounding
Box to the smallest area that contains your mask and enough surrounding detail
to help Stable Diffusion understand the context of what you want it to draw.
You should also update your prompt so that it describes _just_ the area within
the Bounding Box.

Outpainting

If the Bounding Box is placed over an area of Canvas partially filled by an existing Base Layer area and partially by transparent pixels or masks, invoking a new image will use Outpainting, as well as Inpainting any masked areas.


Advanced Features

Features with non-obvious behavior are detailed below, in order to provide clarity on the intent and common use cases we expect for utilizing them.

Toolbar

Mask Options

Creative Tools

Canvas Tools

Compositing / Seam Correction

When doing Inpainting or Outpainting, Invoke needs to merge the pixels generated by Stable Diffusion into your existing image. This is achieved through compositing - the area around the the boundary between your image and the new generation is automatically blended to produce a seamless output. In a fully automatic process, a mask is generated to cover the boundary, and then the area of the boundary is Inpainted.

Although the default options should work well most of the time, sometimes it can help to alter the parameters that control the Compositing. A larger blur and a blur setting have been noted as producing consistently strong results . Strength of 0.7 is best for reducing hard seams.

Infill & Scaling

Hot Keys

The Unified Canvas is a tool that excels when you use hotkeys. You can view the full list of keyboard shortcuts, updated with all new features, by clicking the Keyboard Shortcuts icon at the top right of the InvokeAI WebUI.