Inpainting vs outpainting: what AI fill and expand actually do

By Pixuvia ·

A weathered painted fresco on a palace wall, its right side broken away to bare plaster and brick where the paint is missing.

The difference between inpainting and outpainting is where the new pixels go. Inpainting fills a marked area inside an image: you paint or select the part to replace, and an AI model paints new pixels there that match what surrounds it. Outpainting extends an image past its edges: the canvas grows and the model paints the new strips so they continue the picture. Object removal and generative fill are inpainting; generative expand is outpainting.

Both run on the same idea, a picture plus a mask that says which pixels to paint. The difference is how much real image the model gets to work from, and that explains most of what each is good and bad at. Below: how the models use the surrounding pixels, where they go wrong, how to steer them, and which Pixuvia tools do which.

Opens the full-size image: Diagram of one beach photo with a red lifeguard tower shown twice: on the left the flag above the tower marked as a coral mask for inpainting, on the right the portrait photo centered in a wider 16:9 frame with hatched new canvas on both sides for outpainting.
Our diagram: an inpainting mask has real pixels on every side; outpainting's new canvas touches the photo on one side only.
On this page
  1. Inpainting vs outpainting at a glance
  2. How does AI inpainting work?
  3. How does AI outpainting work?
  4. Where do inpainting and outpainting fail?
  5. How do you get better inpainting and outpainting results?
  6. Which Pixuvia tools inpaint and which outpaint
  7. Questions
  8. Sources

Inpainting vs outpainting at a glance

InpaintingOutpainting
What gets paintedA marked area inside the imageNew canvas outside the original edges
What the model readsReal pixels on every side of the holeReal pixels on one side of each new strip
Common namesObject removal, erase, generative fill, magic eraserExpand, extend, uncrop, generative expand
Good atRemoving people, wires, clutter; replacing one objectChanging aspect ratio, adding sky, sand or headroom
Weak atLarge holes, text, hands, repeating patternsSeams, drifting perspective, new objects far from the photo
In PixuviaErase object, Generative fillExpand image, Generative Expand

How does AI inpainting work?

Every inpainting model gets two inputs: the image with a hole in it, and a mask marking the hole. In the Diffusers library's guide, the mask is white where the model should paint and black where it should keep the picture. What the model paints is decided by what it sees around the hole: the colors, textures, light and lines that run into it.

Older, non-AI fills copy patches of texture from elsewhere in the image. That still works well for small spots, and the Editor's Spot Healing Brush, Remove tool and Content-Aware Fill work that way, with no AI model involved. Learned models go further because they have seen millions of images and can paint something plausible that is not anywhere in yours.

How far a model looks around the hole matters. The LaMa paper (Suvorov and others, WACV 2022) argued that inpainting networks failed on large holes because they could not look far enough, and used fast Fourier convolutions to see the whole image at once. Trained on 256 × 256 pixel images, it held up at around 2000 pixels, including on what the authors call periodic structures: repeating patterns that have to line up.

Opens the full-size image: A pale stucco apartment building with many windows, on the left with trees, cars, signs and window details covered by blue masks, on the right the same building with those areas filled in.
Large-mask inpainting from the LaMa project page (Roman Suvorov and others): masked areas on the left, the model's fill on the right. Published example, not made with our tools.

Diffusion models, such as Stable Diffusion and FLUX, take the masked image as part of their input while they generate. The Stable Diffusion inpainting model card describes five extra input channels for this: four for the encoded masked image and one for the mask. The prompt, when there is one, says what to paint; the surrounding pixels say how it should look so it blends in.

Inpainting-trained models blend more naturally, but the Diffusers guide notes that they are also more likely to change pixels outside the mask. Editing apps therefore usually paste only the masked area back into the original. Pixuvia does this: for Erase, Generative fill and Expand, the AI result is blended onto the full-size original with a soft edge, so the rest of the photo keeps its exact pixels and resolution.

How does AI outpainting work?

Outpainting is inpainting at the edge. It uses the same machinery: put the photo on a larger canvas and mark everything new as the area to paint. Black Forest Labs describe their FLUX.1 Fill models as inpainting and outpainting models that work from a text description and a binary mask, and say outpainting lets you extend images beyond their original borders.

Opens the full-size image: On the left a narrow strip of a man's face showing one eye, centered on a black canvas with arrows pointing outward; on the right the full outpainted portrait of a bearded man.
Outpainting from Black Forest Labs' FLUX.1 Tools announcement: a small crop on a large canvas (left) and the model's extension (right). Published example, not made with our tools.

The catch is context. A hole in the middle of a beach is surrounded by beach. A strip added to the left of a portrait photo touches real pixels only along one edge, and its far side touches nothing. Close to the photo, the model continues what it sees; further out, it has to invent. That is why expanded areas often look convincing near the seam and more generic toward the outer edge.

Where do inpainting and outpainting fail?

Both struggle with text, people, patterns that must line up and areas far from real pixels:

  • Text and signs: letters come out as letter-like shapes. The Stable Diffusion inpainting model card lists "cannot render legible text" among its limitations. Remove text with inpainting if you like, but add new text with a text tool.
  • Hands, faces and people: the same model card warns that faces and people may not be generated properly. Filling over part of a person invites extra fingers and odd joints.
  • Repeating patterns and straight lines: tiles, bricks, fences, window rows and horizons need to line up exactly across the fill. A slight shift in spacing or angle stands out at once.
  • Seams in large expansions: big new areas can show a visible line where the photo ends, a change in grain, or a horizon that steps or tilts.
  • Mismatched light: a filled area can ignore the light direction, miss a shadow the scene needs, or come out a little warmer or cooler than its surroundings.
  • Softer detail: models work at a limited size. Pixuvia sends a copy of at most 4 megapixels and blends the answer back into the full-size photo, so a large filled area can look softer than the sharp pixels around it.
  • Leftovers: a shadow, reflection or edge of the removed object that was not in the mask often stays behind, or the model rebuilds a vague copy of the object from it.

How do you get better inpainting and outpainting results?

Mask carefully, prompt only where the tool asks, and work in small steps.

Selection size and shape

Cover the whole object with a small margin, and include its shadow and any reflection: the model treats anything left outside the mask as part of the scene to match. Don't paint far beyond the object either. The bigger the hole, the more the model has to invent and the less real picture is left to guide it. In the Editor, Generative fill and Erase with AI send the selection plus a margin of half its longest side (at least 64 pixels) on every side, so that margin is what the model reads.

Prompts

A prompt only matters where the tool takes one. Generative fill asks "What goes there": describe the thing you want, short and concrete, such as "a wooden bench" or "calm water". Erase object takes no prompt; it always fills with background. Expand needs no prompt either; it writes its own. If a removal keeps bringing an object back, the cause is usually the mask, not the missing prompt: paint a little wider and include the shadow.

Smaller steps

Several small fills beat one big one: remove one person at a time, or fill a long wire in sections. For expansion, grow one side or a modest amount at a time, check the seam, and continue. In the Editor's Generative Expand you set the exact new size and the anchor, so the photo can stay at one edge while the canvas grows on the other. Results there land on their own layers, so you can mask off a bad part, lower its opacity or delete it and try again; non-destructive editing explains why that matters.

Chat-based editors are heading the same way. With Images 2.6, OpenAI says image markup, already available in ChatGPT, comes to its API so teams can pinpoint exactly where to make changes; our post on ChatGPT Images 2.6 covers that release. Adobe's object removal and image expansion are also coming to the Windows 11 Photos app, as Adobe AI tools in Windows Photos reports.

Which Pixuvia tools inpaint and which outpaint

Inpainting, in the Studio: Erase object (paint over what you want gone with a brush or a lasso, no prompt) and Generative fill (paint an area, then describe what goes there). In the Editor, the same two are Edit > Erase with AI… and Edit > Generative Fill…, working on a selection and adding the result as a new layer. The object remover page runs Erase on its own. For step-by-step help, see how to remove an object from a photo and how to use generative fill.

Opens the full-size image: The Studio's Erase object panel with brush size, Mark with Brush or Lasso, Undo, Clear and two model choices, beside a photo of a red lifeguard tower whose flag and flagpole are painted over in coral.
Inpainting set up in the Studio: Erase object with the flag and its pole painted. The run was not started.

Outpainting: Expand image in the Studio grows the photo to 1:1, 4:5, 16:9 or 9:16 and fills the new edges. The Editor's Image > Generative Expand… takes an exact size in pixels or percent and an anchor, and puts the new area on a layer under the image. The image extender page does it on its own, and how to extend an image background covers which shape to choose for each use.

Opens the full-size image: The Studio's Expand image panel with New shape set to 16:9 and two model choices, beside the portrait photo of the lifeguard tower.
Outpainting set up in the Studio: Expand image on 16:9. The run was not started.
Opens the full-size image: The Editor's Generative Expand dialog with current size 1276 by 1600 pixels, width set to 2844 and height 1600, a centered anchor and two model choices.
The Editor's Generative Expand: an exact new size and where the photo sits in it.

Every AI run uses credits, so set up the mask or shape with care before you start one, and check text, hands and straight lines in the result before you use it. Photo editing terms explained covers masks, layers and the rest of the vocabulary used here. Posting the result? Will Instagram label my edited photo as AI? explains how those labels are decided.

Questions

Is generative fill the same as inpainting?

Yes, generative fill is inpainting with a prompt: you select an area inside the image and describe what should go there, and the model paints it to match the surroundings. Object removal is inpainting without a prompt, where the model fills the area with plausible background.

Is outpainting the same as generative expand?

Yes. Generative expand, expand image and AI extend are names for outpainting: the canvas grows past the photo's edges and a model paints the new area so it continues the picture.

Why does AI fill leave a blurry patch?

Usually because the model worked on a smaller copy of the photo, or the filled area is large. The result is scaled to fit and blended in, so it can look softer than the sharp pixels around it. Fill smaller areas one at a time, or sharpen or add a little grain to the patch.

Can inpainting add text or a logo?

It is unreliable. Many inpainting models produce text-like shapes rather than correct letters; the Stable Diffusion inpainting model card says outright that it cannot render legible text. Add text with a text tool on its own layer instead.

How much can I expand a photo?

Technically a lot, but the further the new area gets from the real pixels, the more the model invents. Growing a portrait photo to 16:9 adds more new canvas than the photo itself. For large changes, expand in smaller steps and check each one.

Sources