stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Add ability to display and/or save inpainting mask and masked composite
Describe what this pull request is trying to achieve.
This exposes the inpainting mask and masked composite to the user, and gives the choice to display these in the web UI, save them to disk, or both. This should make layering inpainting results easier in external software.
Additional notes and description of your changes
All these options are disabled by default, as majority of users will likely not benefit from this feature.
This takes into account the mask blur value. Masked composite is premultiplied. I've done a comparison of the final composited inpainting result vs. the original image + the masked composite, and results are identical, besides the edge expanding slightly less outward (I believe this is due to a minor difference in how the final composite is handled currently in the apply_overlay function, where the mask is inverted).
Environment this was tested in
- OS: Windows 11
- Browser: Firefox
- Graphics card: NVIDIA RTX 3090
Screenshots or videos of your changes
New behavior, when both the mask and masked composite are enabled to display in the web UI:
