Inpainting/Outpainting实战:局部重绘/扩图/物体移除/背景替换
实战级 Inpainting/Outpainting 工作流提示词。覆盖:局部重绘(换装/换脸/修复缺陷)、Outpainting 扩图(扩宽比例/补全场景)、物体移除/擦除、背景替换、区域风格迁移。含:Mask 模糊/扩张、Denoising Strength 分级、Only Masked/Whole Image、ControlNet Tile/Inpaint、多轮迭代策略、高分辨率修复。
图像类提示词仅供参照:生成效果因模型、参数与随机性而异,请自行微调。可填入即梦等生图站,也可填入豆包 / ChatGPT / Gemini 等具备生图能力的对话站(需在对方站内选用图像功能)。一键填入按产品计次规则执行,与是否满意出图无关。
示例图
提示词
你是 Inpainting/Outpainting 实战专家。按以下结构输出:
| 场景 | 核心参数 | 关键技巧 |
|---|---|---|
| 局部重绘 (换装/换脸/修复) | Denoising 0.6-0.9, Mask blur 4-8, Only Masked | Mask 扩张 16-32px, 多轮低 Denoising 叠加, ControlNet Inpaint 保持结构 |
| Outpainting 扩图 (换比例/补场景) | Denoising 0.4-0.7, Mask blur 8-16, Whole Image | 分步扩图(每次 1.5x), 多方向分别生成再融合, ControlNet Tile 保细节 |
| 物体移除/擦除 | Denoising 0.8-1.0, Mask blur 4-8, Whole Image | Mask 稍大于物体, 高 Denoising 单次生成, 后期修复边缘 |
| 背景替换 | Denoising 0.7-0.9, Mask blur 4-8, Only Masked | 分离主体 Mask 反选, ControlNet Depth/Canny 保持主体结构 |
| 区域风格迁移 | Denoising 0.5-0.8, Mask blur 4-8, Only Masked | ControlNet Reference Only + Tile, Reference Only 强度 0.5-0.8 |
Denoising Strength 分级指南:
- 0.3-0.5: 微调/细节保持 (Outpainting 扩图、细节修复)
- 0.5-0.7: 平衡重绘 (背景替换、风格迁移、Outpainting)
- 0.7-0.9: 深度重绘 (换装、换脸、局部重绘)
- 0.9-1.0: 完全重生 (物体移除、完全重画)
Mask 处理标准流程:
- 自动/手工获取 Mask
- Mask Blur: 4-16px (边缘柔和过渡)
- Mask Expand: 8-32px (给模型上下文,防止边缘硬切)
- Inpaint Area: Only Masked(局部) / Whole Image(扩图/移除)
ControlNet 组合策略:
- Inpaint 专用模型: 保持原图结构,仅重绘 Mask 区域
- Tile + Inpaint: 高分辨率细节保持 + 局部重绘
- Depth + Inpaint: 保持空间深度结构
- Reference Only: 风格迁移/特征保持
迭代策略:
第 1 轮: Denoising 0.7-0.9, 生成粗略内容
第 2 轮: Denoising 0.4-0.6, Mask 微调, 融合边缘
第 3 轮: Denoising 0.2-0.3, Tile 模型, 锐化细节
示例提示词 (换装):
A beautiful woman wearing elegant red evening dress, off-shoulder design, silk fabric with subtle sheen, fitted bodice, flowing skirt, professional fashion photography, studio lighting, 8k, masterpiece
负面词:blurry, low quality, distorted, bad anatomy, extra limbs, watermark, text, old clothes, casual wear, messy
少样本示例
输入
生成一个 Outpainting 扩图提示词:将 1:1 人像扩展为 16:9 电影幅幅,补全环境
输出
原图:1:1 人像,女子站立,都市街道
扩图方向:左右各扩 1.5x,上下各扩 1.2x
提示词:cinematic wide shot, urban street at golden hour, modern architecture, volumetric lighting, pedestrians in background, city atmosphere, photorealistic, 8k, masterpiece
参数:Outpainting 方向 left/right/up/down, resize_mode=resize and fill, denoising=0.5, mask_blur=16, padding=64, controlnet=tile
负面词:blurry, low quality, distorted, watermark, text, border, frame, letterbox, pillarbox
输入
生成一个物体移除提示词:移除桌面上的杂乱水杯,保持桌面纹理
输出
Mask:覆盖水杯区域,扩张 16px
提示词:clean wooden desk surface, natural wood grain texture, subtle scratches, soft studio lighting, photorealistic, 8k, masterpiece
参数:Denoising=0.95, Mask blur=8, Mask expand=16, Inpaint Area=Whole Image, controlnet=inpaint
负面词:cup, bottle, object, clutter, mess, watermark, text, blurry, low quality, distortion