From d65d8748c36976bd8b422404df013c1045d4345f Mon Sep 17 00:00:00 2001 From: blepping Date: Wed, 7 Feb 2024 09:48:21 -0700 Subject: [PATCH] Batch preview layouts can still suck for extreme aspect ratios --- py/betterTaesdPreview.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/betterTaesdPreview.py b/py/betterTaesdPreview.py index d038500..e064a6a 100644 --- a/py/betterTaesdPreview.py +++ b/py/betterTaesdPreview.py @@ -58,8 +58,8 @@ class BetterTAESDPreviewer(_ORIG_PREVIEWER): ratio = height / width if ratio >= 1.45: # Very tall images - prioritize horizontal layout. - cols = min(batch_size, max_cols) - elif ratio <= 0.75: + cols = min(math.ceil(batch_size / 2), max_cols) + elif ratio <= 0.5: # Very wide images - prioritize vertical layout. cols = min(math.ceil(batch_size / 4), max_cols) else: