mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
Update ui_extra_networks.py
Added fix to thumbnail images that exceed 70kb to address slowdowns and wasted memory.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user