mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-01 20:35:06 +08:00
Merge pull request #13266 from wkpark/xyz-prepare
xyz_grid: add prepare
This commit is contained in:
commit
ee8e98711b
@ -205,13 +205,14 @@ def csv_string_to_list_strip(data_str):
|
|||||||
|
|
||||||
|
|
||||||
class AxisOption:
|
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.label = label
|
||||||
self.type = type
|
self.type = type
|
||||||
self.apply = apply
|
self.apply = apply
|
||||||
self.format_value = format_value
|
self.format_value = format_value
|
||||||
self.confirm = confirm
|
self.confirm = confirm
|
||||||
self.cost = cost
|
self.cost = cost
|
||||||
|
self.prepare = prepare
|
||||||
self.choices = choices
|
self.choices = choices
|
||||||
|
|
||||||
|
|
||||||
@ -536,6 +537,8 @@ class Script(scripts.Script):
|
|||||||
|
|
||||||
if opt.choices is not None and not csv_mode:
|
if opt.choices is not None and not csv_mode:
|
||||||
valslist = vals_dropdown
|
valslist = vals_dropdown
|
||||||
|
elif opt.prepare is not None:
|
||||||
|
valslist = opt.prepare(vals)
|
||||||
else:
|
else:
|
||||||
valslist = csv_string_to_list_strip(vals)
|
valslist = csv_string_to_list_strip(vals)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user