Inpainting
Inpainting is the generation or replacement of content within a masked or missing region using surrounding context to maintain coherence.
Generative AI in Action
Inpainting is the generation or replacement of selected regions within an existing image while preserving or incorporating surrounding visual context.
- How it is used
- Applies generative image editing to replace or refine selected regions while preserving surrounding visual context.
- How deep it goes
- Explains masking, prompt inference, and sampling controls through a Stable Diffusion workflow, but avoids mathematical model internals.
- Examples
- Demonstrates masking a dog and colored region in a watercolor painting, then inferring its prompt and refining the edit.
- What you can do after
- Apply it via Stable Diffusion’s web interface to mask, prompt, tune, and review localized image edits.
WordPress Power Toolkit: Harness AI to build next-level websites
Inpainting is an AI image-editing technique that replaces or removes selected image content while generating visually consistent content in its place.
- How it is used
- Uses AI image editing to remove or replace unwanted objects while refining visuals for website design.
- How deep it goes
- Explains lasso selection and removal or replacement prompts, but stops short of technical generation internals.
- Examples
- Uses a masked face, red-enamel lips, generated variations, and comparison of the edited picture.
- What you can do after
- Apply it via an AI art tool by lassoing an object, requesting removal or replacement, and selecting a suitable variation.
Read how WordPress Power Toolkit: Harness AI to build next-level websites explains inpainting →
Deep Learning with PyTorch, Second Edition
An image-generation/editing technique that fills in masked regions of an input image using a model and conditioning prompt.
- How it is used
- Applies text-guided, mask-aware diffusion to edit selected image regions without retraining a model.
- How deep it goes
- Explains mask locality and iterative denoising, then demonstrates pipeline invocation while deferring diffusion internals.
- Examples
- Demonstrates replacing a masked horse with a zebra using an image, mask, prompt, negative prompt, and pipeline call.
- What you can do after
- Operate a pretrained Diffusers inpainting pipeline with images, masks, prompts, and generation settings.
Read how Deep Learning with PyTorch, Second Edition explains inpainting →
Related concepts
- generative fillimplemented by · Generative fill is an image-editing feature that generates or replaces visual content within selected regions of an image.
- promptuses · An input, typically containing instructions or context, supplied to an artificial-intelligence model to guide or elicit its output.
- diffusion modeluses · A diffusion model is a generative model that learns to produce data by reversing a process that progressively adds noise to data.
- image generationused by · Image generation is the computational creation of new images from learned models, input data, or specified conditions.
- digital imageuses · A digital image is visual content encoded as data, typically as a two-dimensional arrangement of pixels or equivalent visual elements.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


