-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misplaced inpaint mask in ultrawide images #668
Comments
I've noticed similar results. It works fine for e.g. 768x512, but certain resolutions lead to coordinate system missmatches between what's masked and what's used when inpainting. |
Just found this happens to me with source images that are 768x512, so it being ultra-wide is not required. It seems to resize the mask, because if I draw a vertical line 1/5 and 4/5 across the image, the rightmost one will be just to the left of the centre of the image. EDIT: I just realised that the "canvas" for drawing the inpaint area extends quite a way to the right of the input image. I think the issue is that if your browser is not wide enough, the input image is scaled down but the mask canvas is not. EDIT #2: Zooming out fixes the issue, so the above seems to be the case. |
Good hint. Would be nice ti get a fix for that, so that the mask is also scaled with the window. |
I think I can confirm this assumtion. You can see the two masked areas and the result in the small output window in the same picture. Filled the mask with latent noise in 1 sampling step made it clearly visible. |
We could get around this just by uploading a mask instead of drawing one. Unfortunately, I don't see any information on how to actually create a mask image for uploading. |
It's just a black and white image (no grey or alpha, if I understand correctly), created in the image editing software of your choice, where white is the part you want to change. EDIT: Just noticed you can make part of the image not opaque and that will be regarded as part of the mask when you upload it:
Though I'm not sure how that works with "original" fill pattern (does it still provide the RGB, for example). |
Using external masks works, but the workflow is a lot slower than just using the unbuilt feature. |
In the meantime I'm just cutting out lower res squares of the area I want to inpaint in Photoshop and then pasting them back into the image. |
I'm in the process of figuring this out. Here's a quick-fix you can do to be able to draw accurate masks again: Create a [data-testid="image"] .touch-none canvas {
width: 100% !important;
object-fit: contain;
} then restart the webui. There's an offset between the mouse and the "brush" on the canvas, but ignoring one's actual mouse cursor, it's possible to draw the mask. |
@AUTOMATIC1111 does this functionality come completely out of gradio? Because I couldn't find any reference to the masks/canvasess in the code of this repo. |
It seems like they are aware over at gradio that something's not right with the inpainting functionality and are working on an overhaul: gradio-app/gradio#1721 |
@48design Thank you so much for investigating and finally fixing this! Unfortunately if you place an image in the inpainting tab, you always get an error if you switch the tab and then switch back to inpainting. |
If I inpaint in an image with 960x384 pixels, the mask is misplaced somehow.
In the result, the marked area is inpainted. Not the face. I tried a lot of different parameters, but can't influence it.
The text was updated successfully, but these errors were encountered: