Updated xy_grid infotext formatting, parser regex

This commit is contained in:
RnDMonkey 2022-10-01 13:56:29 -07:00
parent cf141157e7
commit eba0c29dbc
2 changed files with 9 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import re
import gradio as gr
re_param_code = r"\s*([\w ]+):\s*([^,]+)(?:,|$)"
re_param_code = r"\s*([\w ]+):\s*((?:{[^}]+})|(?:[^,]+))(?:,|$)"
re_param = re.compile(re_param_code)
re_params = re.compile(r"^(?:" + re_param_code + "){3,}$")
re_imagesize = re.compile(r"^(\d+)x(\d+)$")

View File

@ -245,12 +245,16 @@ class Script(scripts.Script):
return process_images(pc)
if not x_opt.label == 'Nothing':
p.extra_generation_params["X/Y Plot X Type"] = x_opt.label
p.extra_generation_params["X Values"] = '{' + ", ".join([f'{x}' for x in xs]) + '}'
p.extra_generation_params["XY Plot X Type"] = x_opt.label
p.extra_generation_params["X Values"] = '{' + x_values + '}'
if x_opt.label in ["Seed","Var. seed"] and not no_fixed_seeds:
p.extra_generation_params["Fixed X Values"] = '{' + ", ".join([str(x) for x in xs])+ '}'
if not y_opt.label == 'Nothing':
p.extra_generation_params["X/Y Plot Y Type"] = y_opt.label
p.extra_generation_params["Y Values"] = '{' + ", ".join([f'{y}' for y in ys]) + '}'
p.extra_generation_params["XY Plot Y Type"] = y_opt.label
p.extra_generation_params["Y Values"] = '{' + y_values + '}'
if y_opt.label in ["Seed","Var. seed"] and not no_fixed_seeds:
p.extra_generation_params["Fixed Y Values"] = '{' + ", ".join([str(y) for y in ys])+ '}'
processed = draw_xy_grid(
p,