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

Add Padding input to PyTorch Upscale node #2966

Merged
merged 2 commits into from
Jun 30, 2024

Conversation

RunDevelopment
Copy link
Member

I recently upscaled a few tileable normal maps, and using Pad + Crop to add padding was really annoying. It's doable, but requires a bunch of nodes if you want to do it for arbitrary model scales, and even that isn't enough with Custom Scale. So I added a "Padding" option that automatically adds 16px of padding to the image depending on what the user selects.

Note that the padding size isn't configurable. The Padding option is supposed to be a simple way to get commonly-used functionality that is good enough. It's just like how you can't choose an interpolation method. This simplicity is by design. If you need more control, you can implement it yourself with chaiNNer's existing nodes.

This should also make upscaling easier for beginners, as a very simple Upscaling chain now provides a lot of features. In particular, simple upscaling chains are now more powerful than CupScale. With this, I would consider the Upscale Image node to be feature-complete.

This
image

is equivalent to this (assuming Custom Scale isn't used):
image

Copy link
Member

@joeyballentine joeyballentine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty good solution, nice work 👍

@joeyballentine joeyballentine merged commit 49d68b2 into chaiNNer-org:main Jun 30, 2024
14 checks passed
@RunDevelopment RunDevelopment deleted the upscale_padding branch June 30, 2024 18:48
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