mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-24 10:51:03 -08:00
switch to PNG when images too large
This commit is contained in:
parent
9d2299ed0b
commit
8ce613bb3a
1 changed files with 5 additions and 0 deletions
|
|
@ -600,6 +600,11 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
|
|||
"""
|
||||
namegen = FilenameGenerator(p, seed, prompt, image)
|
||||
|
||||
# WebP and JPG formats have maximum dimension limits of 16383 and 65535 respectively. switch to PNG which has a much higher limit
|
||||
if (image.height > 65535 or image.width > 65535) and extension.lower() in ("jpg", "jpeg") or (image.height > 16383 or image.width > 16383) and extension.lower() == "webp":
|
||||
print('Image dimensions too large; saving as PNG')
|
||||
extension = ".png"
|
||||
|
||||
if save_to_dirs is None:
|
||||
save_to_dirs = (grid and opts.grid_save_to_dirs) or (not grid and opts.save_to_dirs and not no_prompt)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue