# Masking for AI

**Masking** is a fundamental technique in Fater used to **isolate specific areas** of your image on the canvas. By creating a mask, you tell the AI models precisely _where_ you want them to apply their effects, such as generating new content (inpainting), removing objects, or applying targeted enhancements.

***

### What is a Mask?

Think of a mask as a digital stencil or selection overlaying your image layers within the **Image Editor**.

* **Masked Areas:** The parts of the image covered by the mask are considered "selected" or "active" for AI operations.
* **Unmasked Areas:** The parts _not_ covered by the mask are typically protected or ignored by AI processes that use masks (like inpainting).

**Visual Representation:**

On the Fater canvas, the mask is usually shown as a **semi-transparent light blue overlay**. This allows you to see the underlying image while identifying the masked region.

***

### Why Use Masking?

Masking provides essential control for targeted AI manipulation:

* **Precise Editing:** Instead of having the AI alter the entire image, you can direct it to change only a specific object, person, or area.
* **Object Removal/Replacement:** Mask the object you want to remove or replace, then prompt the AI to fill that area appropriately (inpainting).
* **Targeted Generation:** Generate specific elements _into_ an existing scene by masking the desired location and prompting for the element.
* **Selective Upscaling/Enhancement:** Apply AI upscaling or effects only to certain parts of an image (model dependent).

***

### Creating Masks

Fater offers several ways to create masks within the **Image Editor**, primarily using the **Inpaint Toolbar**:

* **Manual Tools:**
  * **Brush:** Paint directly onto the canvas to create freeform mask areas.
  * **Rectangle:** Draw rectangular mask selections.
  * **Polygonal Lasso:** Create precise selections by drawing connected straight lines to form a polygon.
* **AI-Powered Masking (via Agent):**
  * Use the **"Prompt to Mask"** tool (Text Search icon) or interact with the **Agent**. Describe the object you want to select (e.g., "select the red car"), and the AI will attempt to generate a mask for it. You can subtract instead these AI masks from your manual selections by Alt Clicking the button instead.
* **From Layer Content:**
  * Use the **"Apply Mask to Layer"** action (Wand icon) available on individual layers in the Layers Tab. This uses the visible pixels of _that layer_ to define a mask shape, which can then be added to or subtracted (alt clic) from the main mask.

_(See the_ [using-editing-and-masking-tools](using-editing-and-masking-tools "mention") _guides for detailed instructions on each method.)_

***

### Masks and the Generation Area

It's crucial to remember:

* Masks can only be drawn **inside** the current **Generation Area Bounding Box**.
* AI operations that use masks will only consider the masked pixels **within** that same bounding box.

***

### Common AI Uses for Masks

* **Inpainting/Outpainting:** Models in the "Edit" category heavily rely on masks to know where to fill or modify content.
* **Content Removal:** AI models designed for object removal use the mask to identify what to erase and replace seamlessly.
* **Masked Upscaling:** Some upscaling models allow applying the effect only within a masked region, preserving the unmasked areas.

***

### Managing Your Mask

Once created, you can modify your mask using actions from the **Inpaint Toolbar**, such as:

* Clearing the entire mask.
* Inverting the selection.
* Inflating or deflating the edges.
* Keeping only the border pixels.
* Undoing/Redoing mask changes using the Mask History.

_(See_ [manipulating-masks](using-editing-and-masking-tools/manipulating-masks "mention") _and_ [managing-mask-history](using-editing-and-masking-tools/managing-mask-history "mention") _for details.)_

***

Effectively using masks is essential for leveraging Fater's powerful AI editing capabilities with precision and control.
