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

Why the image size must be aligned to 64? #143

Open
Tr1stesse opened this issue Nov 26, 2024 · 1 comment
Open

Why the image size must be aligned to 64? #143

Tr1stesse opened this issue Nov 26, 2024 · 1 comment

Comments

@Tr1stesse
Copy link

In generate function:

        width, height = input_image.size
        factor = args.resolution / max(width, height)
        factor = math.ceil(min(width, height) * factor / 64) * 64 / min(width, height)
        width = int((width * factor) // 64) * 64
        height = int((height * factor) // 64) * 64
        input_image = ImageOps.fit(input_image, (width, height), method=Image.Resampling.LANCZOS)

This can lead to unexpected clipping. Can this be changed by modifying the parameters?

@csyhping
Copy link

Same problem here. Sometimes there will be a resolution loss (original res: 300 * 419 -> out res: 296 * 416)

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

No branches or pull requests

2 participants