aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/xyz_grid.py
diff options
context:
space:
mode:
authorVladimir Mandic <mandic00@live.com>2023-03-11 13:33:55 +0000
committerGitHub <noreply@github.com>2023-03-11 13:33:55 +0000
commita47c18297e1611568c732e6e6922d5be9def7c47 (patch)
treebe8b8bd06c6ad8ad80b84210fee70c47c5db6446 /scripts/xyz_grid.py
parent1226028b9c1b153b6ceef62d8678ecb84c9d4fcd (diff)
downloadstable-diffusion-webui-gfx803-a47c18297e1611568c732e6e6922d5be9def7c47.tar.gz
stable-diffusion-webui-gfx803-a47c18297e1611568c732e6e6922d5be9def7c47.tar.bz2
stable-diffusion-webui-gfx803-a47c18297e1611568c732e6e6922d5be9def7c47.zip
use assert instead of return
Diffstat (limited to 'scripts/xyz_grid.py')
-rw-r--r--scripts/xyz_grid.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py
index 8c816a73..44f7374c 100644
--- a/scripts/xyz_grid.py
+++ b/scripts/xyz_grid.py
@@ -485,10 +485,9 @@ class Script(scripts.Script):
zs = process_axis(z_opt, z_values)
# this could be moved to common code, but unlikely to be ever triggered anywhere else
- Image.MAX_IMAGE_PIXELS = opts.img_max_size_mp * 1000000 * 1.1 # allow 10% overhead for margins and legend
+ Image.MAX_IMAGE_PIXELS = opts.img_max_size_mp * 1.1 # allow 10% overhead for margins and legend
grid_mp = round(len(xs) * len(ys) * len(zs) * p.width * p.height / 1000000)
- if grid_mp > opts.img_max_size_mp:
- return Processed(p, [], p.seed, info=f'Error: Resulting grid would be too large ({grid_mp} MPixels) (max configured size is {opts.img_max_size_mp} MPixels)')
+ assert grid_mp < opts.img_max_size_mp, f'Error: Resulting grid would be too large ({grid_mp} MPixels) (max configured size is {opts.img_max_size_mp} MPixels)'
def fix_axis_seeds(axis_opt, axis_list):
if axis_opt.label in ['Seed', 'Var. seed']: