Update ui_extra_networks.py

Added fix to thumbnail images that exceed 70kb to address slowdowns and wasted memory.
This commit is contained in:
Aptronymist
2023-08-08 11:43:38 -04:00
parent ff2d846667
commit 196fa29ee0
+1 -1
View File
@@ -140,7 +140,7 @@ class ExtraNetworksPage:
continue
try:
img = Image.open(f)
if img.width > 1024 or img.height > 1024:
if img.width > 1024 or img.height > 1024 or os.path.getsize(f) > 70000:
img = img.convert('RGB')
img.thumbnail((512, 512), Image.HAMMING)
img.save(fn)