diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-09-30 06:17:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-30 06:17:24 +0000 |
commit | ee8e98711ba658f61b12288dd801f10ae937f604 (patch) | |
tree | b27a5fa8d64f7ba6ff8847f2d1c60446b2b770e2 /scripts/xyz_grid.py | |
parent | 87b50397a6da273fe0160016a209e4eb0cbf4a89 (diff) | |
parent | afd06245876004710007fa1abd0a1b4b2564c181 (diff) | |
download | stable-diffusion-webui-gfx803-ee8e98711ba658f61b12288dd801f10ae937f604.tar.gz stable-diffusion-webui-gfx803-ee8e98711ba658f61b12288dd801f10ae937f604.tar.bz2 stable-diffusion-webui-gfx803-ee8e98711ba658f61b12288dd801f10ae937f604.zip |
Merge pull request #13266 from wkpark/xyz-prepare
xyz_grid: add prepare
Diffstat (limited to 'scripts/xyz_grid.py')
-rw-r--r-- | scripts/xyz_grid.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py index 99ad96be..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)
|