stable-diffusion-webui
stable-diffusion-webui copied to clipboard
adds checks for resulting image size to avoid memory issues
adds field in Settings -> Saving Images/Grids -> Maximum image size, in megapixels
(implemented as shared.opts.img_max_size_mp
)
enforces a check inside xyz grid script as that is common place where this issue occurs. on error, results will be none and error will be printed in webui (using infotext).
closes #8051 closes #8164
I would suggest this be added to common code, Last week I ran into this error without using the xyz grid script, when I did an extremely large batch (800 images, 858MB, 37120x20160, 748.34 Megapixel Grid Image) and attempted to zip the result.
In many ways, I think it would also be useful if the grid image could just be split every 100 images or so, creating multiple grids for extra large batches, as well as an option to skip zipping the grid image itself when zipping batches.
fair point. i'll take a look at that as well, but lets get this comited first.
The intended approach is to throw rather than return something. Do this with assert
.
I modified image.py to generate big grid images :D
The intended approach is to throw rather than return something. Do this with
assert
.
done.
What's with this change? The error message is twice the set value and even generating a 2x1 64px grid far exceeds the default value.
DecompressionBombError: Image size (4096 pixels) exceeds limit of 440.00000000000006 pixels, could be decompression bomb DOS attack.
I set MAX_IMAGE_PIXELS to None in PIL/Image.py :), that's work