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 ESRGAN size requirement #121

Merged
merged 3 commits into from
Jan 16, 2024
Merged

Fix ESRGAN size requirement #121

merged 3 commits into from
Jan 16, 2024

Conversation

RunDevelopment
Copy link
Member

As I explained here, ESRGAN models only conform with the call API, if the output image size is a multiple of 4. The easiest way to guarantee this is by making sure the input size is a multiple of 4.

@joeyballentine
Copy link
Member

Are you 100% sure this is a universal thing and not just a thing with realesrgan-type models? The realesrgan ones trained for 1x are really just 4x models with pixelunshuffle, hence needing to be a multiple of 4. Since regular 1x models don't have this restriction, I wouldn't think they would need to be a multiple of 4. Can you confirm this? There's no reason a normal 1x conv network like esrgan should have that limitation unless we're doing something wrong in the code

@joeyballentine
Copy link
Member

Specifically, this is the code that should be causing that:

It should only be getting called when a shuffle factor is set.

@RunDevelopment
Copy link
Member Author

You're right. This only affects realesrgan-type models. I'll change it.

@joeyballentine
Copy link
Member

For technical reasons I think this should actually be a multiple of the scale (before it is adjusted by the shuffle factor for tagging reasons) -- But since nothing of that nature is out in the wild i don't think we need to worry about it

@joeyballentine joeyballentine merged commit b930a8e into main Jan 16, 2024
7 checks passed
@joeyballentine joeyballentine deleted the ESRGAN-size-req branch January 16, 2024 00:35
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.

2 participants