Przejdź do treści
promptowy.com / AI Glossary / Inpainting
Image, video, and audio

Inpainting

Inpainting is an AI technique that reconstructs, replaces, or removes selected parts of an image while preserving the surrounding style, lighting, and context.

Inpainting is an artificial intelligence technique used to restore, modify, or erase specific regions within an image. Instead of editing an entire picture from scratch, a user selects a target area using a digital brush known as a mask, describes the desired modification with a text prompt or leaves it blank, and lets an AI model generate new pixels that blend seamlessly into the existing scene.

Known in many consumer photo editors as generative fill, inpainting handles the tedious work of matching lighting, grain, colour palettes, and perspective. Whether you want to eliminate an accidental photobomber, replace an outdated item of clothing, or repair a ripped family portrait, inpainting fills the gap so cleanly that the modification is often impossible to spot with the naked eye.

How AI inpainting works

Traditional photo retouching relied on tools like the clone stamp or basic healing brushes, which merely copied pixels from another area of the same picture. Generative inpainting works on an entirely different principle by reading the visual context of the whole image.

When you brush over an unwanted element, the underlying neural network analyses the surrounding pixels. It evaluates shadows, direction of light, depth of field, and fine surface textures such as brickwork, wood grain, or fabric weave. If you provide a text prompt such as "a ceramic coffee mug", the AI synthesises that object from its training data, scaling it to fit the table surface and casting natural shadows according to the room's existing light sources. If you leave the prompt empty or instruct the tool to remove the object, the model predicts what background surfaces should logically sit behind the masked area.

Real-world applications in small business and daily life

Inpainting has quickly shifted from an experimental research tool to an everyday asset for professionals, community organisations, and independent businesses across the UK and the United States.

  • High street retail and catering: An independent bakery in Leeds or a coffee shop in Portland can photograph fresh merchandise quickly on a busy counter, then use inpainting to paint out messy electrical cords, plastic price tags, or an untidy stack of receipts.
  • Property and estate agency: An estate agent in Bristol or a real estate agent in Denver preparing marketing materials can clean up exterior shots by removing parked delivery vans, council bins left on the pavement, or temporary roadwork signs.
  • Heritage and community archives: Local history societies and school libraries routinely use inpainting to digitally repair torn, creased, or water-damaged photographs of historic town centres without altering the faces of the people pictured.

Inpainting versus outpainting

While inpainting works strictly inside the boundaries of an existing photograph, a companion technique known as outpainting works in reverse. Outpainting allows you to extend the canvas outward in any direction. For instance, if you have a tight vertical portrait that you need to repurpose as a horizontal banner for a website header, inpainting can tweak the subject's shirt collar, while outpainting invents the missing landscape, office interior, or street scene to the left and right of the frame.

Best practices and common mistakes

Achieving realistic results with inpainting requires a bit of technique. Here are the most important practices to keep in mind:

  1. Mask slightly beyond the target object: The most frequent beginner mistake is drawing a mask that hugs an object too tightly. If you leave out the cast shadow on the floor or the reflection in a nearby window, the final render will look uncanny. Always include edges, shadows, and contact points in your selection mask.
  2. Keep prompts simple and contextual: When adding an object, describe only what belongs inside the masked hole. Do not re-describe the entire image, as this can confuse the model about what needs to change.
  3. Match the original resolution: Running inpainting on heavily compressed or tiny images forces the model to guess fine details, which can lead to blurry patches or unnatural sharpness that clashes with the rest of the photograph.

How to configure this in Midjourney, FLUX, Ideogram, GPT Image, and ComfyUI, with side-by-side test comparisons: Inpainting in Generator Parameters

Frequently asked questions

What is the difference between inpainting and content-aware fill?

Content-aware fill samples and repeats existing pixels from the same image, whereas AI inpainting generates brand-new, context-aware imagery using a deep learning model.

Do I always need to type a prompt to use inpainting?

No, if your goal is simply to remove an object or blemish, most tools allow you to mask the area and let the AI automatically fill in the background without any written prompt.

Can inpainting change faces or clothing in portraits?

Yes, by masking only the face or clothing and typing a descriptive prompt, you can alter expressions, hairstyle, or attire while keeping the pose, lighting, and background intact.

← All terms in the AI Glossary

🛒 Sklep Kinetyka CapCut Pro 460 zł/rok Lovable Pro 450 zł/rok Replit Core 119 zł/rok Zobacz wszystko →
× ‹ powiększenie ›