Skip to content

Inpaint imporvements#1357

Open
stduhpf wants to merge 2 commits intoleejet:masterfrom
stduhpf:inpaint-imporvements
Open

Inpaint imporvements#1357
stduhpf wants to merge 2 commits intoleejet:masterfrom
stduhpf:inpaint-imporvements

Conversation

@stduhpf
Copy link
Contributor

@stduhpf stduhpf commented Mar 19, 2026

  • For all models in inpaint mode: Improve mask downsampling to latent size by taking the maximum over the 8x8 patch instead of a single sample in the corner

  • For inpaint models: Use masked diffusion for inpaint models too, to reduce color shift. That was previously disabled because of some artifacting near the edges of the mask, it is fixed by inflating the mask by 1 latent pixel for diffusion.

Example:

.\build\bin\sd-cli.exe --model ..\ComfyUI\models\checkpoints\sdxl\dreamshaperXL_lightningInpaint.safetensors -p "a dog sitting on a bench" --color --steps 16 --cfg-scale 1 --sampling-method euler_a --preview proj --preview-noisy --img-cfg-scale 1 -i .\bench.png --mask .\bench_mask.png --strength 1

original mask
bench bench_mask
master PR
master PR
PR just enabling masked diffusion without inflating the mask
PR no-inflate

(not very noticable difference in that specific example, but there are some noticable "floaters" around the masked areas in the image on the right if you look closely)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant