aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/xyz_grid.py
diff options
context:
space:
mode:
authorhako-mikan <122196982+hako-mikan@users.noreply.github.com>2023-11-09 12:57:57 +0000
committerGitHub <noreply@github.com>2023-11-09 12:57:57 +0000
commit816096e642187a18b11e2729c42c0b5f677f047d (patch)
tree8127b07b946b376d4276e2169ceffb7c2e64ba09 /scripts/xyz_grid.py
parent6b9795849d497b41514aa9462690cf7c2802e4f6 (diff)
parent5e80d9ee99c5899e5e2b130408ffb65a0585a62a (diff)
downloadstable-diffusion-webui-gfx803-816096e642187a18b11e2729c42c0b5f677f047d.tar.gz
stable-diffusion-webui-gfx803-816096e642187a18b11e2729c42c0b5f677f047d.tar.bz2
stable-diffusion-webui-gfx803-816096e642187a18b11e2729c42c0b5f677f047d.zip
Merge branch 'dev' into master
Diffstat (limited to 'scripts/xyz_grid.py')
-rw-r--r--scripts/xyz_grid.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py
index 939d8605..0dc255bc 100644
--- a/scripts/xyz_grid.py
+++ b/scripts/xyz_grid.py
@@ -205,13 +205,14 @@ def csv_string_to_list_strip(data_str):
class AxisOption:
- def __init__(self, label, type, apply, format_value=format_value_add_label, confirm=None, cost=0.0, choices=None):
+ def __init__(self, label, type, apply, format_value=format_value_add_label, confirm=None, cost=0.0, choices=None, prepare=None):
self.label = label
self.type = type
self.apply = apply
self.format_value = format_value
self.confirm = confirm
self.cost = cost
+ self.prepare = prepare
self.choices = choices
@@ -536,6 +537,8 @@ class Script(scripts.Script):
if opt.choices is not None and not csv_mode:
valslist = vals_dropdown
+ elif opt.prepare is not None:
+ valslist = opt.prepare(vals)
else:
valslist = csv_string_to_list_strip(vals)
@@ -773,6 +776,8 @@ class Script(scripts.Script):
# TODO: See previous comment about intentional data misalignment.
adj_g = g-1 if g > 0 else g
images.save_image(processed.images[g], p.outpath_grids, "xyz_grid", info=processed.infotexts[g], extension=opts.grid_format, prompt=processed.all_prompts[adj_g], seed=processed.all_seeds[adj_g], grid=True, p=processed)
+ if not include_sub_grids: # if not include_sub_grids then skip saving after the first grid
+ break
if not include_sub_grids:
# Done with sub-grids, drop all related information: