> For the complete documentation index, see [llms.txt](https://docs.qolaba.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.qolaba.ai/image-generation/image-editing/image-inpainting.md).

# Image Inpainting

Image Inpainting lets you selectively replace or modify a specific area of an existing image — using a brush to mask the region and a text prompt to define what replaces it. Everything outside the masked area remains exactly as it was.

***

#### What Inpainting Does

When you mask an area and enter a prompt, the model replaces that region with newly generated content that matches the context and style of the surrounding image. This allows precise, targeted edits without touching any other part of the image.

**Common use cases:**

* Removing unwanted objects or people from a scene
* Replacing a product background in a specific zone
* Changing clothing, accessories, or color on a subject
* Fixing generation artifacts or anatomical errors
* Adding new elements to an existing composition
* Swapping text or signage within an image

***

#### How to Use Inpainting

* **Step 1 —** Open **Image Editing → Inpainting** from the workspace.
* **Step 2 —** Upload the image you want to edit, or select one from your generation history.
* **Step 3 —** Adjust the **brush size** to match the area you need to mask. Use a larger brush for broad areas and a smaller brush for precise detail work.
* **Step 4 —** Paint over the area you want to replace. The masked region is highlighted — review it to make sure only the intended area is covered.
* **Step 5 —** Enter a prompt in the prompt field describing what should replace the masked area.
* **Step 6 —** Click **Generate**. The model fills the masked region with new content based on your prompt while preserving everything outside it.

***

#### Brush Controls

<table><thead><tr><th width="261.921875">Control</th><th>What It Does</th></tr></thead><tbody><tr><td><strong>Brush Size</strong></td><td>Increase or decrease the brush diameter for broad or precise masking</td></tr><tr><td><strong>Undo</strong></td><td>Step back through masking actions to correct mistakes</td></tr><tr><td><strong>Redo</strong></td><td>Reapply a previously undone masking action</td></tr><tr><td><strong>View Original</strong></td><td>Toggle between the original image and the edited output for comparison</td></tr></tbody></table>

***

#### Writing Effective Inpainting Prompts

Inpainting prompts work differently from generation prompts — they need to describe the replacement content in relation to the surrounding image context.

**Be specific about the replacement:**

```
A wooden dining chair with a white cushion.
```

```
Clear blue sky with soft white clouds.
```

```
A bouquet of red roses in a glass vase.
```

**Reference the surrounding context when relevant:**

```
Smooth concrete wall matching the surrounding texture.
```

```
Continue the forest background with dense green foliage.
```

**For removal without replacement:**

```
Empty background matching the surrounding wall texture.
```

```
Clean white studio background.
```

> **Tip:** The more specific your replacement prompt, the more accurately the model fills the masked area. Vague prompts like *"something better"* or *"fix this"* produce inconsistent results. Describe exactly what you want to appear.

***

#### Tips for Clean Inpainting Results

* **Mask precisely** — over-masking areas you want to keep causes the model to alter them. Use a small brush for edges and detailed boundaries
* **Use a slightly larger mask than needed** — masking just inside the boundary of an object sometimes leaves visible seams. Extend the mask slightly beyond the object edge for cleaner blending
* **Match context in your prompt** — if the surrounding image has a specific lighting style or texture, reference it in your prompt so the replacement blends naturally
* **Use Undo to refine the mask** — take time to get the mask right before generating. A clean mask produces a dramatically better result than a rushed one
* **Compare with View Original** — always compare the output against the original before downloading to verify the edit looks natural


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.qolaba.ai/image-generation/image-editing/image-inpainting.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.
