aboutsummaryrefslogtreecommitdiff
path: root/scripts/xy_grid.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-24 08:23:01 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-09-24 08:23:01 +0300
commit31ac0baba069f4b9470b4c0812c1e2b7583df512 (patch)
treee0359bf0794bc47066fce3f18ae23170491daaa2 /scripts/xy_grid.py
parented8b8b3b8c4f5bea89a2dc32fb48c83a123a11cd (diff)
Reformat some changes from the previous commit.
Diffstat (limited to 'scripts/xy_grid.py')
-rw-r--r--scripts/xy_grid.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py
index cb1312ae..3a2e103f 100644
--- a/scripts/xy_grid.py
+++ b/scripts/xy_grid.py
@@ -102,7 +102,7 @@ def draw_xy_grid(p, xs, ys, x_labels, y_labels, cell, draw_legend):
for iy, y in enumerate(ys):
for ix, x in enumerate(xs):
- state.job = f"Image {ix + iy * len(xs) + 1} out of {state.job_count}"
+ state.job = f"{ix + iy * len(xs) + 1} out of {len(xs) * len(ys)}"
processed = cell(x, y)
if first_pocessed is None:
@@ -141,11 +141,11 @@ class Script(scripts.Script):
y_values = gr.Textbox(label="Y values", visible=False, lines=1)
draw_legend = gr.Checkbox(label='Draw legend', value=True)
- fixed_seeds = gr.Checkbox(label='Resolve random seeds before plotting (only applies when plotting "-1" seed values for X or Y axis)', value=False)
+ no_fixed_seeds = gr.Checkbox(label='Keep -1 for seeds', value=False)
- return [x_type, x_values, y_type, y_values, draw_legend, fixed_seeds]
+ return [x_type, x_values, y_type, y_values, draw_legend, no_fixed_seeds]
- def run(self, p, x_type, x_values, y_type, y_values, draw_legend, fixed_seeds):
+ def run(self, p, x_type, x_values, y_type, y_values, draw_legend, no_fixed_seeds):
modules.processing.fix_seed(p)
p.batch_size = 1
@@ -170,7 +170,7 @@ class Script(scripts.Script):
end = int(mc.group(2))
num = int(mc.group(3)) if mc.group(3) is not None else 1
- valslist_ext += [int(x) for x in np.linspace(start = start, stop = end, num = num).tolist()]
+ valslist_ext += [int(x) for x in np.linspace(start=start, stop=end, num=num).tolist()]
else:
valslist_ext.append(val)
@@ -192,7 +192,7 @@ class Script(scripts.Script):
end = float(mc.group(2))
num = int(mc.group(3)) if mc.group(3) is not None else 1
- valslist_ext += np.linspace(start = start, stop = end, num = num).tolist()
+ valslist_ext += np.linspace(start=start, stop=end, num=num).tolist()
else:
valslist_ext.append(val)
@@ -214,7 +214,7 @@ class Script(scripts.Script):
else:
return axis_list
- if fixed_seeds == True:
+ if not no_fixed_seeds:
xs = fix_axis_seeds(x_opt, xs)
ys = fix_axis_seeds(y_opt, ys)
@@ -225,10 +225,7 @@ class Script(scripts.Script):
else:
total_steps = p.steps * len(xs) * len(ys)
- if p.n_iter > 1:
- print(f"Number of seeds/images per prompt is {p.n_iter}.")
-
- print(f"X/Y plot will create {len(xs) * len(ys) * p.n_iter} images on a {len(xs)} x {len(ys)} grid. (Total steps to process: {total_steps * p.n_iter})")
+ print(f"X/Y plot will create {len(xs) * len(ys) * p.n_iter} images on a {len(xs)}x{len(ys)} grid. (Total steps to process: {total_steps * p.n_iter})")
shared.total_tqdm.updateTotal(total_steps * p.n_iter)
def cell(x, y):