From 3dd09fde08c81fdebf39af2172433e4afe356d13 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:08:50 -0700 Subject: [PATCH] Syntax change --- modules/image/grid.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/image/grid.py b/modules/image/grid.py index 4a3f38d6e..cca8056d6 100644 --- a/modules/image/grid.py +++ b/modules/image/grid.py @@ -37,10 +37,11 @@ def check_grid_size(imgs: list[Image.Image] | list[list[Image.Image]] | None): def get_grid_size(imgs: list, batch_size=1, rows: int | None = None, cols: int | None = None): rows_int, cols_int = len(imgs), len(imgs) if rows is None and cols is None: - if n_rows := shared.opts.n_rows >= 0: + n_rows, n_cols = shared.opts.n_rows, shared.opts.n_cols + if n_rows >= 0: rows_int: int = batch_size if n_rows == 0 else n_rows cols_int = math.ceil(len(imgs) / rows_int) - elif n_cols := shared.opts.n_cols >= 0: + elif n_cols >= 0: cols_int: int = batch_size if n_cols == 0 else n_cols rows_int = math.ceil(len(imgs) / cols_int) else: