Zubnet AI学习Wiki › Inpainting
Using AI

Inpainting

Image Inpainting, Outpainting
用匹配周围上下文的 AI 生成内容填充图像中被选中的区域。你 mask 一个区域(把它涂掉),描述应该用什么替换它,模型生成与现有图像无缝融合的新内容。Outpainting 把图像扩展到原始边界之外。两者都用同一个底层扩散过程,以未 mask 的区域为条件。

为什么重要

Inpainting 是 AI 提供的最实用的图像编辑工具。移除不想要的物体、替换背景、修复瑕疵、添加元素、或修改图像特定部分,同时保持其他一切不变。这是 Photoshop 的内容感知填充的 AI 等价物,但由自然语言引导,能力也强得多。

Deep Dive

The process: (1) provide an original image, (2) create a mask indicating which region to regenerate, (3) optionally provide a text prompt describing what should appear in the masked region, (4) the model denoises only the masked area while keeping the unmasked area fixed, using the surrounding context to ensure coherence. The model sees the entire image (both masked and unmasked regions) during generation, ensuring the new content matches lighting, perspective, and style.

Outpainting

Outpainting extends the image canvas: imagine taking a portrait photo and extending it to show the full room. The model generates new content at the borders that's consistent with the existing image. This is useful for: changing aspect ratios (turning a square image into a landscape), adding context to cropped images, and creating panoramic views from single photos. The quality depends on how much context the original image provides.

Best Practices

For clean inpainting results: mask slightly larger than the area you want to change (the model handles transitions better with some overlap), provide a descriptive prompt for the replacement content, use appropriate denoising strength (0.7–0.9 for replacing content, 0.3–0.5 for subtle modifications), and ensure the mask edges are feathered rather than sharp for seamless blending.

相关概念

← 所有术语
ESC