Skip to content

Inpaint improvements#1357

Merged
leejet merged 5 commits intoleejet:masterfrom
stduhpf:inpaint-imporvements
Apr 5, 2026
Merged

Inpaint improvements#1357
leejet merged 5 commits intoleejet:masterfrom
stduhpf:inpaint-imporvements

Conversation

@stduhpf
Copy link
Copy Markdown
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 (also re-enabled that feature altogether that was disabled in refactor: migrate generation pipeline to sd::Tensor #1373)

  • 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
no masked diffusion (old master) PR
master PR
PR current master
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)

@stduhpf stduhpf force-pushed the inpaint-imporvements branch from 50974ff to 6d484cd Compare March 30, 2026 15:36
@stduhpf stduhpf changed the title Inpaint imporvements Inpaint improvements Mar 30, 2026
@leejet leejet merged commit 9369ab7 into leejet:master Apr 5, 2026
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.

2 participants