Skip to content
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

Fix inpaint only masked + Integer upscale in inpaint only masked #16243

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

light-and-ray
Copy link
Contributor

@light-and-ray light-and-ray commented Jul 20, 2024

Description

Fixes bug: pasted image is shifted right and down on factor number of pixels after it was upscaled by this factor

This bug wasn't seen very often because rounded scale factor was almost always 1, and mask blur by default hides this artifact

Also this PR adds option to correct padding to have integer upscale on applying overlay

Screenshots/videos:

Original:
original

Options: padding=28, mask_blur=0, resolution=451x451, bad quality because I've used LCM, do not care about it

Old behavior:
old

Integer option on, but bug exists:
integer_and_NO_fix
Here scale factor become 2, and it started look like a disaster. And this can happen and happens in current behavior anciently, if scale factor > 1 and upscale non integer

Integer option on and fixed bug:
integer_and_fix

Because this integer upscale correction can increase padding on 50-150 pixels, I've made it optional. If option is off, result is still better then the old behavior, but upscale is not integer (worse fit, better resolution):

Integer option off and fixed bug:
fix

Checklist:

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.

1 participant