To replace an object in a photo, paint over it, describe what should be there instead, and generate. Only the painted area changes. The rest of the photograph is preserved exactly as it was.
That last part is what makes this different from ordinary AI image editing. Most image models rebuild the entire picture, so asking for a new sofa hands you a new room. Inpainting confines the change to the region you marked.
This walkthrough uses a template called Replace Objects with Inpaint, which takes one photograph of a living room and produces three different rooms from it: a new chair, new wall art, a new coffee table, each swapped into the identical scene.
Below is the step by step build in Picsart Flow, plus what inpainting actually is, why the mask matters more than the prompt, and how the technique differs from outpainting.
How to replace an object in a photo, step by step
Open the template from Picsart Flow templates. Its canvas carries a note that states the method in two lines: paint over any object or area, describe what should replace it, and generate a new version while preserving the rest of the image.
Built by Anahit Melikyan, it is deliberately minimal. There is one source photograph and three edits, and nothing else on the canvas to distract from the technique.
Step 1. Bring in your image
Drop your photo onto the canvas as an image node. This is the source every edit reads from, so it is worth starting with the sharpest, best lit version you have.
The template ships with a sunlit living room already in place: cream sofa, arched window, round marble coffee table, abstract art on a beige wall, ceramics on built in shelves.
Step 2. Open Inpaint from the node’s actions
Select the image node and open its actions menu. Inpaint is the first entry, and the interface describes it in one line: mark the area, say what should be there.
Outpaint, Animate, Remove background and Edit image sit under it. They all read from the same node, which is why an image can branch in several directions at once.
Step 3. Paint the mask
Brush over the object you want gone. On the template’s cover image this is rendered literally, with the sofa filled in bright magenta so you can see exactly which pixels have been marked.
Cover the whole object, including its shadow and any part of it that overlaps something else. A mask that stops at the object’s edge tends to leave a ghost of the original silhouette behind.
Step 4. Describe what belongs there
Write the replacement as a short description of the object in its setting, not as a list of adjectives. Four things are worth naming every time:
- Material. Leather, boucle, marble, raw oak.
- Form. Low and chunky, tall and spindly, curved, angular.
- Colour. Specific enough to picture, loose enough to sit in the existing palette.
- Position. Where it meets the floor, the wall or the surface it stands on.
Let the original photograph supply the light. Prompts that over specify lighting tend to fight what the model can already see.
Swap the sofa
A sculptural lounge chair with a curved terracotta leather frame and a soft cream boucle cushion, sitting where the sofa was, same floor contact and same shadow direction
Change the wall art
A large abstract painting in burgundy, dusty pink and terracotta, filling the existing frame on the wall, same size and same hanging position
Replace the coffee table
A low wooden coffee table with a thick organic slab top and chunky rounded legs, standing on the woven rug where the marble table was
Step 5. Generate and branch
Run it, and the result arrives as a new node wired to the original rather than replacing it. The source image stays on the canvas untouched, which matters more than it sounds.
That is what lets you run the next edit from the same starting point instead of editing an edit, and it is the structural idea the whole template is built around.
One photo, three rooms
The template’s canvas is not a chain. It is a fan.
A single image node sits on the left and three connectors run from the same output port to three separate results on the right. One replaces the sofa with the terracotta lounge chair. One changes the wall art to the burgundy abstract. One swaps the marble coffee table for the wooden one.
None of the three is built on top of another. Each one reads the original photograph, masks a different object, and returns a full size version of the room with that one thing changed.
The reason to build it this way is comparability. Because every variant starts from identical pixels, the only difference between the three outputs is the object you asked for. The light is the same, the shadows fall the same way, the shelving and the olive tree and the arched window are pixel for pixel identical.
Chain the edits instead, and each one inherits whatever the previous step got slightly wrong. Fan them out, and you get three clean answers to three separate questions.
That is the pattern worth stealing from this template, whatever you are editing. Put the finished image on the canvas once, then branch every variation off it.
What is inpainting?
Now the theory, because knowing what the technique is doing makes the failures easier to diagnose.
Inpainting is targeted image editing. The name comes from art restoration, where a conservator fills a damaged patch of a canvas so the repair disappears into the surrounding paint. The software version does the same job, with a prompt instead of a brush loaded with pigment.
You supply three things and the model returns one:
- The image you want to change.
- A mask, which is the area you paint over to mark as editable.
- A prompt describing what belongs in that area instead.
What comes back is the same image with only the masked region rewritten. The lighting, the perspective, the colour grade and every unmasked pixel carry over.
The mask is the part people underestimate. It is not a selection in the Photoshop sense, where you are cutting something out. It is a permission slip. You are telling the model which pixels it is allowed to touch and, by omission, which ones it must leave alone.
That makes inpainting the right tool for a specific shape of problem: the picture is nearly right, and one thing in it is wrong.
How does inpainting work?
The model reads the unmasked part of the image as context, then generates new content for the masked part that has to agree with everything around it.
Agreement is the hard bit. A new object dropped into a photo has to match the light direction, the shadow length, the lens distortion, the grain and the colour temperature of the original, or the eye catches it instantly.
So the useful way to think about the prompt is that you are not describing an object in isolation. You are describing an object that has to belong in a scene the model can already see.
A few consequences follow from that, and they explain most of the results people find confusing:
- Bigger masks give the model more freedom. A tight mask around an object constrains it to that silhouette. A generous mask lets it change the object’s shape.
- The surrounding image is doing half the work. A well lit, sharp original produces a clean edit. A blurry or oddly lit one produces a patch that looks pasted.
- Empty masks still get filled. If you mask an object and describe nothing, the model will generally reconstruct the background behind it, which is how inpainting doubles as object removal.
- The edit is a new image, not a layer. The result is a fresh version of the picture rather than a stack you can peel back.
Inpainting vs outpainting vs generative fill
These three terms describe overlapping things and get used interchangeably, which is why the comparison is worth pinning down.
| Term | What it changes | Where the new pixels go |
|---|---|---|
| Inpainting | A region inside the image | Inside the original frame |
| Outpainting | The area beyond the image | Outside the original frame |
| Generative fill | Either, depending on the tool | Either |
Inpainting works inward. The frame stays the same size and one region inside it is rewritten.
Outpainting works outward. The frame gets bigger and the model invents what would have been there if the camera had been pulled back. It is the tool for turning a portrait crop into a landscape one, or for giving a tight product shot some breathing room.
Generative fill is a product name more than a technique. It usually covers both operations behind one button, which is convenient in use and imprecise in conversation. If someone says generative fill, ask whether they mean the inward edit or the outward one.
The two are siblings rather than rivals, and tools that offer one usually offer the other. In Picsart Flow they sit in the same actions menu on an image node, which is worth reading once because it maps the whole family of edits available from a single picture:
- Inpaint. Mask a region inside the frame and prompt a replacement for it.
- Outpaint. Extend the frame outward and let the model fill the new space.
- Animate. Turn the still into a short video.
- Remove background. Output the subject on transparency.
- Edit image. Crop, flip and resize.
What inpainting is actually good for
The technique earns its place whenever reshooting or regenerating the whole image is disproportionate to the size of the problem.
- Swapping one object. A different chair, a different bottle, a different jacket, in an otherwise finished frame.
- Removing something. Mask it, describe the background, and the object is gone.
- Fixing a detail the generator got wrong. A malformed hand, a garbled sign, a logo that came out as nonsense.
- Trying variations. Same scene, same light, one element changed, so the comparison is honest.
- Changing a surface. New upholstery, new wall colour, new tabletop material, without touching the shape.
- Product mockups. Placing a real item into a scene that is already lit and composed.
The last two are why inpainting turns up so often in interiors, retail and mockup work. Those disciplines all involve an image where the setting is settled and the merchandise is the variable.
Tips for cleaner inpainting results
Mask past the edge
Paint slightly beyond the object's outline and include its shadow. Stopping exactly at the silhouette is the most common reason a replacement looks pasted on.
Describe the object in its scene
Name material, form and colour, then let the original image supply the lighting. Prompts that over specify light usually fight the photo.
Change one thing per generation
Masking a sofa and a rug together gives you no way to tell which half of the prompt caused a bad result.
Branch, do not stack
Run every variant from the same source node so your comparisons are honest. Editing an edit compounds errors.
Leave the prompt empty to remove
Mask an object, describe nothing, and the model reconstructs the background behind it.
Start from the sharpest original you have
Inpainting reads the unmasked pixels as context, so a soft or badly lit source limits how well the new region can blend.
Get answers to common questions
It is editing one part of an image with AI. You paint over the area you want changed, describe what should be there instead, and the rest of the picture stays exactly as it was.
Start with one object and one mask
Inpainting is the smallest useful AI edit there is. One region, one prompt, everything else preserved.
Open Replace Objects with Inpaint in Picsart Flow, swap the living room for a photo of your own, and paint over the one thing in it you would change.