d8ahazard / sd_smartprocess

Smart Pre-processing extension for Stable Diffusion
194 stars 19 forks source link

Update smartprocess.py #30

Open james-things opened 1 year ago

james-things commented 1 year ago

I went to use the padding function and it didn't work for me, so I did some digging and it looks like the padding functionality was broken by the following commit:

https://github.com/d8ahazard/sd_smartprocess/commit/1def06d8a4a897664bc083c2e2af3436d107f008#diff-d56db42c60f8fc9165345312bcb110d898f38738e8206e548039e86b9b3245fd

It appears that the original issue was unintentional padding when not selecting "pad" in the UI, however I believe the intended solution was to indent lines 377-340, rather than 325-350 which ended up in the commit. The current state of the code is such that "pad" can only be reached within "crop." I have adjusted the indentation to restore padding without bringing back the original issue; I believe the unintentional padding was caused by 377-340 not being indented, so there was no conditional checking the "if not cropped properly, crop again" catch there.

Addresses issue: https://github.com/d8ahazard/sd_smartprocess/issues/27 as well :)