# How to Inpaint: Edit One Part of an Image

> Inpainting masks a region and regenerates only that: Midjourney Vary (Region), Firefly Generative Fill, ChatGPT, or Stable Diffusion locally.

- Canonical: https://guides-ai.pages.dev/guides/ai-image-inpainting/
- Plate 12.03 · Topic: AI images (https://guides-ai.pages.dev/topics/image/)
- Published: 02 Sept 2026 · Updated: 06 Sept 2026 · 3 min read
- Source site: guides-ai — https://guides-ai.pages.dev/

**Inpainting** regenerates a masked region of an existing image and leaves every pixel outside
the mask untouched. It is how you remove an object, fix a hand, or swap a background detail
without redrawing the whole picture.

## 1. Open the image in a tool that masks

- **Midjourney** — upscale a result, then click **Vary (Region)** to open the editor. On
  midjourney.com the same inpainting tool is built into the Editor.
- **Adobe Firefly / Photoshop** — Generative Fill: select an area, type a prompt.
- **ChatGPT** — upload an image and ask for a specific change; it re-renders the region.
- **Stable Diffusion locally** (ComfyUI, Automatic1111) — full control over mask, denoise
  strength and prompt. Best for repeated edits.

## 2. Mask slightly larger than the object

Midjourney's own guidance is that selection size matters: a bigger selection gives the model
more surrounding context to match, while too large a selection lets it replace things you
wanted kept. Start a little wider than the object's edge — tight masks leave a visible seam.

## 3. Prompt for the masked area only

```text
Clear blue sky with thin high cloud, matching the warm afternoon light in the rest of the photo.
```

What it does: describes what belongs *inside* the mask plus the lighting to match. Describing
the whole scene makes the model drift outside the selection.

For removal, describe the background that should be there rather than the removal itself —
"empty grass field, matching lighting" works where "remove this" does not. In Midjourney,
editing the prompt inside the Vary (Region) editor requires Remix Mode turned on.

## If it fails

A pasted-in look almost always means the mask edge, not the prompt. Run a second small inpaint
pass over just the seam, or redo the mask with a softer, wider edge. If the model keeps
changing things outside the selection, your prompt is describing the whole image.

This is a [diffusion model](/glossary/#diffusion-model) working from noise, so the same mask
and prompt give a different result each run — regenerate before you rewrite the prompt. Next:
[remove an image background with AI](/guides/remove-background-with-ai/) or
[build a first ComfyUI workflow](/guides/comfyui-first-workflow/) for repeatable local edits.

Source: [Midjourney Vary (Region) documentation](https://docs.midjourney.com/hc/en-us/articles/32794723105549-Vary-Region).
