Inpainting

AI inpainting: change one area of an image, or redo it?

Inpainting means changing one area and keeping the rest. What the studio offers for it, how to describe only the change, blend the edge, and when to redo.

5 min read
A square brass plate with one round window cut out floats above a dark glossy surface, a violet beam passing through the window and landing as a soft bright circle below

You have a picture that is ninety percent right. The hands are fine, the light is lovely, the mood is exactly what you wanted, and then there is the lamp that looks like a melted candle. Starting over would throw away the ninety percent. Changing only the lamp is called inpainting, and it is the most useful editing idea in AI images. It is also the one most often promised more than it delivers, so this guide starts with what the studio really does.

What the studio offers, honestly

There is no brush in the studio. You cannot drag a circle over the lamp and type a new prompt. What you get is a choice between three kinds of model, and they protect the rest of your picture to different degrees.

  • Instruction editors. You upload the picture and write one sentence. The model repaints the whole frame while trying to honour your lock sentence (keep everything else unchanged). Nothing physically stops a small detail elsewhere from drifting.
  • Mask editors. You upload the picture and a second image that marks the area. Ideogram V4.5 Edit is one, and it also has a precision setting that puts back the pixels you did not ask to change.
  • Erasers. A mask model that only removes, covered in removing people from travel photos.

The mask is a plain black and white picture you make in any image editor, at exactly the size of the photo. Do not assume the colours: one model reads black as the area to edit and white as the area to keep, while the eraser reads white as the area to remove. The model page tells you which, so read it before you paint.

Step 1: select less than you think, but not too tight

Mark the object plus a small margin: its shadow, its reflection, the rim where it meets the table. A mask that follows the outline exactly leaves a thin ring of the old object, and the model then tries to continue it. A margin gives it clean surroundings to copy. The opposite mistake is a huge area, because everything inside it is redrawn from scratch and the more you mark, the more can change.

Step 2: describe only the change

Do not describe the whole picture again. The model can see it. Write what goes into the marked area, then what must stay. If you are new to this kind of wording, how to write edit prompts goes deeper.

Prompt
In the marked area, replace the lamp with a slim brass desk lamp, switched on, throwing warm light to the left. Keep the desk, the books, the window and the colour of the room unchanged.
No mask? Use the same text and say where: the lamp on the right side of the desk.

Step 3: help the edge blend

The seam is where an edit gets caught. A new object that is sharper, warmer or lit from another side than its neighbours looks pasted, even when it is well drawn. The studio does no blending after the fact, so the blending has to be in your words.

  1. Name the light that already exists: window light from the left, warm lamp glow, overcast sky.
  2. Name the shadow: say where the new object's shadow falls and how soft it is.
  3. Match the material and the grain: a matte object in a grainy film photo should be matte and grainy too.
  4. Keep the change the same size as the thing it replaces unless you want the room to move with it.

Step 4: compare at full size

Put the original and the result side by side at full size and look at the edges of the edited area, then at details far from it: a ring, a word on a sign, the pattern of a rug. Instruction editors may nudge those. If something you cared about moved, that is your signal to try a mask editor or to redo the picture, not to keep stacking edits.

When to redo instead

Patching has a limit, and knowing it saves money. Three questions decide.

  • Is the flaw a detail or a decision? A wrong lamp, a stray cable, a bad sign is a detail: patch it. A wrong pose, a wrong camera angle or a crowded layout is a decision, and no patch fixes it.
  • Is the area large? Past a third of the frame you are asking for a new picture with extra steps. Write a better prompt instead, and keep the old one as a reference image, as described in how much of your photo an AI edit should keep.
  • Has it failed twice? Two misses with a sharper prompt usually mean the model cannot draw that thing. Hands and lettering are the classic case, see fixing hands and text, and a different model is the better next move than a third try.

Redoing is not a defeat. If you reuse the same prompt with one changed word, the new picture often keeps the composition you liked. The seed guide explains how far that goes and where it stops.

What it will not do

An edit never recovers information that is not in the picture. Remove a person and the model invents what was behind them: plausible, not real. Faces, logos and small lettering inside an edited area can come back changed. And no model in the catalog is guaranteed to leave every other pixel alone, except where a model page says so for a setting, such as the precision switch above. Check the page of the model you pick and the result at full size.

Questions

Does the studio have an inpainting brush?

No. Some models take a mask image that you prepare in another program, and the rest take a written instruction. The model page says which inputs it accepts.

Why did the rest of my picture change a little?

Instruction editors repaint the whole frame. Add a lock sentence that names what must stay, or use a mask editor with its precision setting on.

How big should the mask be?

The object plus a small margin that covers its shadow and edge. A tight outline leaves a ring of the old object, and a huge area lets too much change.

When is it better to generate again?

When the flaw is the pose, the angle or the layout, when the area is a large part of the frame, or when two careful edits have failed.

#Inpainting#Editing#Images

Keep reading

All articles →