From 196fa29ee0c133c2a0ff789ab341b00d01e548c7 Mon Sep 17 00:00:00 2001 From: Aptronymist <108482020+Aptronymist@users.noreply.github.com> Date: Tue, 8 Aug 2023 11:43:38 -0400 Subject: [PATCH] Update ui_extra_networks.py Added fix to thumbnail images that exceed 70kb to address slowdowns and wasted memory. --- modules/ui_extra_networks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 591e64028..f5c8f2a93 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -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)