mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-19 21:00:14 +08:00
format
This commit is contained in:
parent
c8d453e915
commit
d20eb11c9e
@ -175,18 +175,22 @@ def do_nothing(p, x, xs):
|
|||||||
def format_nothing(p, opt, x):
|
def format_nothing(p, opt, x):
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def format_remove_path(p, opt, x):
|
def format_remove_path(p, opt, x):
|
||||||
return os.path.basename(x)
|
return os.path.basename(x)
|
||||||
|
|
||||||
|
|
||||||
def str_permutations(x):
|
def str_permutations(x):
|
||||||
"""dummy function for specifying it in AxisOption's type when you want to get a list of permutations"""
|
"""dummy function for specifying it in AxisOption's type when you want to get a list of permutations"""
|
||||||
return x
|
return x
|
||||||
|
|
||||||
|
|
||||||
def list_to_csv_string(data_list):
|
def list_to_csv_string(data_list):
|
||||||
with StringIO() as o:
|
with StringIO() as o:
|
||||||
csv.writer(o).writerow(data_list)
|
csv.writer(o).writerow(data_list)
|
||||||
return o.getvalue().strip()
|
return o.getvalue().strip()
|
||||||
|
|
||||||
|
|
||||||
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):
|
||||||
self.label = label
|
self.label = label
|
||||||
@ -203,6 +207,7 @@ class AxisOptionImg2Img(AxisOption):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.is_img2img = True
|
self.is_img2img = True
|
||||||
|
|
||||||
|
|
||||||
class AxisOptionTxt2Img(AxisOption):
|
class AxisOptionTxt2Img(AxisOption):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
@ -294,7 +299,6 @@ def draw_xyz_grid(p, xs, ys, zs, x_labels, y_labels, z_labels, cell, draw_legend
|
|||||||
cell_size = processed_result.images[0].size
|
cell_size = processed_result.images[0].size
|
||||||
processed_result.images[idx] = Image.new(cell_mode, cell_size)
|
processed_result.images[idx] = Image.new(cell_mode, cell_size)
|
||||||
|
|
||||||
|
|
||||||
if first_axes_processed == 'x':
|
if first_axes_processed == 'x':
|
||||||
for ix, x in enumerate(xs):
|
for ix, x in enumerate(xs):
|
||||||
if second_axes_processed == 'y':
|
if second_axes_processed == 'y':
|
||||||
|
Loading…
Reference in New Issue
Block a user