# 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 & Masking Tools](/fater-ai-docs/using-editing-and-masking-tools/introduction-to-the-inpaint-toolbar.md) *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](/fater-ai-docs/using-editing-and-masking-tools/manipulating-masks.md) *and* [Managing Mask History](/fater-ai-docs/using-editing-and-masking-tools/managing-mask-history.md) *for details.)*

***

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fater.gitbook.io/fater-ai-docs/masking-for-ai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
