inpainting vs outpainting vs SDEdit
inpainting
mask inside, pin outside
9-channel U-Net:
noisy | encoded_src | mask
outpainting
invert the mask
extend beyond the canvas
same model, same loss
SDEdit (no retraining)
x_0 -> add noise to t -> denoise
t/T = 0.3 → minor edits
t/T = 0.6 → moderate edits
t/T = 0.9 → near-random
no mask, just noise-level slider
inpainting inference loop
for t = T .. 1: x_t[masked] = denoise; x_t[unmasked] = noise(clean_source, t)
replace unmasked region with a fresh forward-diffused clean image each step
final step: pin unmasked pixels to the clean source exactly
2026 editing stack
SAM 2 mask → SD-Inpaint / Flux-Fill / GPT-Image Edit → Flux-Kontext for instruction edits