Syntax change

This commit is contained in:
awsr
2026-03-30 20:08:50 -07:00
parent 95dadab5c3
commit 3dd09fde08
+3 -2
View File
@@ -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: