This PR adds a simple slider below the Expand Mask button which allows the user to specify the number of iterations to use for the mask expansion operation.
Motivation for Change
Often times, dilating the mask region a single time is not enough to really impact the result in inpainting/cleaning. I often found myself having to spam the Expand Mask button which was slow since every time you press the button you have to wait for the image to reload before you can press again. This PR aims to make everyone's life a bit easier by just allowing them to set the number of iterations (dilation steps) for the Expand Mask operation.
Additional Changes
Increased the limit to the number of iterations within inpaint_anything.py::expand_mask(). Previously, the range was set to values of 1-5 however this seemed needlessly small so I upped the limit to 100 to reflect the max value of the slider.
Tests
[x] Tested various values for the iteration count slider.
[x] Compared manually expanding mask 1 at a time for 15 iterations and expanding mask using an iteration count of 15. Both gave same result.
Thanks for your contribution. I believe this is a valuable feature, as it fits well within the available space in the UI. I'll merge this pull request.
Brief
This PR adds a simple slider below the
Expand Mask
button which allows the user to specify the number of iterations to use for the mask expansion operation.Motivation for Change
Often times, dilating the mask region a single time is not enough to really impact the result in inpainting/cleaning. I often found myself having to spam the
Expand Mask
button which was slow since every time you press the button you have to wait for the image to reload before you can press again. This PR aims to make everyone's life a bit easier by just allowing them to set the number of iterations (dilation steps) for theExpand Mask
operation.Additional Changes
inpaint_anything.py::expand_mask()
. Previously, the range was set to values of 1-5 however this seemed needlessly small so I upped the limit to 100 to reflect the max value of the slider.Tests