-
Notifications
You must be signed in to change notification settings - Fork 44
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
[Feature] Keep Original Mask Contents #99
Comments
i suspect you're running into the decoupled reticle/SD resolution, which is actually by design but has a PR and related issue which optionally syncs the resolution to the cursor and vice versa. with the current main-branch version (v0.0.9.6), if you expand the stable diffusion settings and set the resolution value to match your reticle size, does the output match your expectations? [edit] |
Try inpainting a 1920x1080 image. Then choosing 1024px square, inpaint, then download the canvas. Now open the original and the new canvas images in your pc’s photo gallery and quickly switch between the two and focus on the image where the square was. Do you not see a lower res in the new canvas compared to the original? Download the two images I uploaded and quickly switch between them using your pc’s photo viewer, you’ll see a clear degradation in quality for the new canvas |
Have you changed generation resolution as well as cursor size when inpainting? |
Are you sure you're increasing the canvas size? Watch this vid, this is what I'm doing exactly: https://streamable.com/zv7wpi I attached before generation and after generation pics below. You can see a clear degredation in quality of the stuff that was inside the box (download the two pics and quickly switch between the two to see the difference) |
Yeah, so that's the thing... We cannot really keep the generation resolution the same and increase the cursor without losing quality in the process, as we are effectively generating the image in 512x512 and scaling it up to the final resolution using just normal image scaling. If you are refering to the unmasked regions (that should not be modified) we can see and try a fix, manually keeping these areas. But for the actual region expected to be modified/inpainted, keeping same resolution as input is impossible, unless we we run the upscaling function in the mix. But at that point upscaling should actually be its own tool. |
"If you are refering to the unmasked regions (that should not be modified)" yup that's exactly what i'm referring to. I understand the masked region will be a little lower res and that's fine, but if you can add an option to keep the unmasked regions completely the same that would be perfect! |
Maybe you should give full resolution inpainting a try, but as in this case it has no context outside of the area being inpainted, you need to be more specific with your prompts. |
That makes sense... Will check what it would take to implement this. Probably will only really apply to fully opaque masking to avoid dealing with averaging the images. Would that be okay to you? |
Yup that would be good, thanks a lot |
This is not a bug anymore, but a feature request. We have to implement a feature to reapply masked surfaces to the image received from the remote before displaying them to the user (probably controlled by a checkbox or something). - Keep-masked maybe? |
a fix for #99 Signed-off-by: Victor Seiji Hariki <[email protected]>
Hi, @mpmo10, can you check if the implementation is okay for this feature? It's on the An option was added, and is enabled by default, where all fully masked pixels on the original image are kept. |
Tried it just now, yes perfect! thanks a lot. But I do notice that when I have "Keep Masked" off, it does a better job at blending in the edges of the masked with unmaked. But when the "Keep Masked" is turned on, you can see the lines of where the mask brush has been more clearly. Is there a way to make it blend in more when "Keep Masked" is turned on? I tried increasing the "Mask blur" to 20 but even at that high value the edges of the masked and unmasked parts don't blend in that well as when "Keep Masked" is off. And going higher than 30 Mask blur makes the inpainting generations worse for some reason |
Well, that's kind of to be expected, as we have a very crisp original image right beside an area of the image that was generated at low res. We can try adding a keep image blur slider if you want, but it will be a simple gaussian blur, so I do not guarantee that it will be anywhere near good. |
Yeah a gaussian blur slider would be great 🙏🏼 (even better if changing the slider would change the image in real time) |
If you have any other ideas for implementation, please tell us so we can try! For now, will implement a slider for blur, but that's the only thing that we can do for now. |
In real time... would be kind of difficult, considering now we have multiple concurrent generations/image picking. This pull will include a non-realtime implementation, but will see what I can do in the future. |
Check now the testing branch. |
Can you open the console, disable caching and reload the page? It should have a slider under keepMasked. |
I imagine you ran |
Aha ok I see it. Yess it does work. Thanks for adding this feature!! |
Describe the bug
When I try to inpaint an image and I make the square more than 512px, the image inside the square becomes lower res. I like making the "D" (Dream) square bigger because the bigger it is, the better the inpainting will be since the AI will have a clearer understanding of the whole image.
To Reproduce
Steps to reproduce the behavior:
Upload an image, inpaint part of it with the Mask Brush (M) tool, make the generation Dream (D) square 1024px (or any res higher than 512px, but 1024px is the most obvious) instead of the default 512px square by moving the mouse scroll wheel upwards, generate an image and compare before and after of what's inside the box.
Expected behavior
For the image that's not been masked and that's inside the "D" Dream square box not to become lower res and stay the same after generation
(First image is before generation, second image is after). See how the stars and city lights are lower res. This doesn't happen when the square is 512px. Even if I increase the square, the unmasked image inside the square shouldn't be affected but as you can see it is being affected
The text was updated successfully, but these errors were encountered: