# Inpainting with the Draw Mask Canvas

This guide provides a detailed walkthrough for using the powerful inpainting features of the AI Generation Job. Inpainting allows you to regenerate a *specific part* of an image, which is perfect for fixing small errors, adding new details, or completely changing an object within a texture. This is all done using the `IMG2IMG` workflow and the integrated **Draw Mask** view.

## 1. Understanding the Inpainting View

The inpainting process is handled within the **Input** viewport. It combines a standard texture input with a special drawing canvas.

#### **Switching to Draw Mask View**

1. First, select an `IMG2IMG` workflow (e.g., `IMG2IMG.json`).
2. In the **TextureInputs** category, provide a texture to the **Img2Img INPUT** slot. This will be the image you draw on.
3. Above the input viewport, you will see a segmented control for the view mode. Click on **"Draw Mask"** to enter the interactive canvas.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FXkav96n85sOwyh3iJk1f%2Fimage.png?alt=media&#x26;token=c554f6c4-25c8-4580-9202-6680b3382913" alt=""><figcaption></figcaption></figure>

In this view, the Img2Img input texture is used as the background. You can now draw directly on it to create your inpainting mask. The masked area will be shown with a semi-transparent red overlay.

## 2. The Brush Options Toolbar

When you are in the Draw Mask view, a toolbar appears at the top of the canvas, giving you full control over your brush.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FgHNakAxmKqIml1zVy5Nf%2Fimage.png?alt=media&#x26;token=1668ea9a-fbbf-42c6-a21f-775ad38e7c24" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FZzDEL4KwYLPPp3Cv6g7c%2Fimage.png?alt=media&#x26;token=009ed3d5-2e06-4f02-86eb-076110f445e3" alt=""><figcaption></figcaption></figure>

* **Type:** Choose your brush style.
  * **Regular:** A standard, circular brush.
  * **Spray:** A spray-paint effect that places multiple dots within the brush radius.
* **Size:** Controls the overall radius of your brush.
  * **Shortcut:** Use the **Mouse Wheel** to change the brush size.
* **Feather:** Controls the softness of the brush edge. A higher value creates a smoother blend.
  * **Shortcut:** Hold **Shift + Mouse Wheel** to change the feather amount.
* **Density (Spray Only):** Controls how many dots are placed with each application of the spray brush.
* **Splatter (Spray Only):** Controls the size of the individual dots within the spray.
* **Clear Mask:** A button that instantly erases the entire mask, filling it with black.

#### **Drawing and Erasing**

* **Draw (Add to Mask):** Hold the **Left Mouse Button** to draw on the canvas. This will paint white into the mask, which appears as a red overlay. The AI will only regenerate these areas.
* **Erase (Remove from Mask):** Hold the **Right Mouse Button** to erase parts of your mask. This paints black into the mask, removing the red overlay.

## 3. Step-by-Step Inpainting Guide

Let's walk through a complete example: adding ivy on top of a brick wall texture.

1. **Select Workflow and Input:**
   * Choose the `IMG2IMG.json` workflow.
   * Drag your brick wall texture into the **Img2Img INPUT** slot.
2. **Enter Draw Mask View:**
   * Click the **"Draw Mask"** button in the input viewport's mode selector.
3. **Draw Your Mask:**
   * Use the brush tools to draw a path where you want the ivy to grow. Use the **Left Mouse Button** to paint the area. Don't worry about being perfect; an organic shape is often better.
4. **Enable Inpainting and Set Prompt:**
   * In the **IMG2IMG** category in the Details panel, check the box for **Enable Inpaint**.
   * In the **Positive Prompt**, describe what should appear *inside the masked area*. For example: `(masterpiece, best quality), lush green ivy climbing the wall, detailed leaves, overgrown`.
5. **Adjust Denoise:**
   * For inpainting, a higher **KSampler\_Denoise** value (e.g., `0.7` to `1.0`) is often best, as it gives the AI more freedom to create the new object from scratch.
6. **Generate:**
   * Click the main "Generate" button. The AI will process the image, replacing only the area you masked with ivy that matches your prompt.

<figure><img src="https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FbWVWSs4doIioB7MhG2uS%2Fimage.png?alt=media&#x26;token=e416b3ee-5ea7-4dee-b39f-f647e5b51d39" alt=""><figcaption></figcaption></figure>
