Skip to content

Restore asymmetric padding in DownSampleBlock::forward#1132

Closed
wwoodsTM wants to merge 1 commit intoleejet:masterfrom
wwoodsTM:restore-asymmetric-padding
Closed

Restore asymmetric padding in DownSampleBlock::forward#1132
wwoodsTM wants to merge 1 commit intoleejet:masterfrom
wwoodsTM:restore-asymmetric-padding

Conversation

@wwoodsTM
Copy link
Copy Markdown

I noticed that after commit 50ff966 that I was getting 8-pixel borders added to the top and left of all my inpainting outputs (with images of any dimensions). I experimented with different fixes until I found this one key line in DownSampleBlock::forward (common.hpp) that seems to be contributing to the 2x2x2 (8 px) offset / borders that I was seeing. I also attempted to keep circular padding in there while maintaining the original behavior overall.

Now whether this is the ideal fix for all use cases I am not 100% sure, but I am hoping someone with more expertise can see if this is a valid fix as it has been working well so far.

Thank you.

…rward while keeping circular padding support
@wbruna
Copy link
Copy Markdown
Contributor

wbruna commented Dec 23, 2025

I can't say if this is the right fix for inpainting, but at least #1128 (another image size related bug) still happens with this change.

@leejet
Copy link
Copy Markdown
Owner

leejet commented Dec 23, 2025

Thanks, but I think #1133 would be a better fix.

@wwoodsTM
Copy link
Copy Markdown
Author

Thanks, but I think #1133 would be a better fix.

Agreed, I just tried the newest commit with this fix and it also resolves the bug. Idk if my little PR was even helpful at the end of the day lol, especially if this was already a known issue, but it was nice to learn a bit about the code base either way. Thanks to anybody who took a look or tested!

@wwoodsTM
Copy link
Copy Markdown
Author

Closing this since it was resolved by #1133

@wwoodsTM wwoodsTM closed this Dec 24, 2025
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.

3 participants