diff options
author | DepFA <35278260+dfaker@users.noreply.github.com> | 2022-10-06 03:04:50 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-06 15:09:49 +0000 |
commit | 5d0e6ab8567bda2ee8f5ed31f332ca07c1b84b98 (patch) | |
tree | 6a283748528e395bf47411d266ab8b342e6a085e /scripts/xy_grid.py | |
parent | fec71e4de24b65b0f205a3c071b71651bbcb0dfc (diff) | |
download | stable-diffusion-webui-gfx803-5d0e6ab8567bda2ee8f5ed31f332ca07c1b84b98.tar.gz stable-diffusion-webui-gfx803-5d0e6ab8567bda2ee8f5ed31f332ca07c1b84b98.tar.bz2 stable-diffusion-webui-gfx803-5d0e6ab8567bda2ee8f5ed31f332ca07c1b84b98.zip |
Allow escaping of commas in xy_grid
Diffstat (limited to 'scripts/xy_grid.py')
-rw-r--r-- | scripts/xy_grid.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py index 1237e754..210829a7 100644 --- a/scripts/xy_grid.py +++ b/scripts/xy_grid.py @@ -168,6 +168,7 @@ re_range_float = re.compile(r"\s*([+-]?\s*\d+(?:.\d*)?)\s*-\s*([+-]?\s*\d+(?:.\d re_range_count = re.compile(r"\s*([+-]?\s*\d+)\s*-\s*([+-]?\s*\d+)(?:\s*\[(\d+)\s*\])?\s*")
re_range_count_float = re.compile(r"\s*([+-]?\s*\d+(?:.\d*)?)\s*-\s*([+-]?\s*\d+(?:.\d*)?)(?:\s*\[(\d+(?:.\d*)?)\s*\])?\s*")
+re_non_escaped_comma = re.compile(r"(?<!\\),")
class Script(scripts.Script):
def title(self):
@@ -197,7 +198,7 @@ class Script(scripts.Script): if opt.label == 'Nothing':
return [0]
- valslist = [x.strip() for x in vals.split(",")]
+ valslist = [x.replace('\\,',',').strip() for x in re_non_escaped_comma.split(vals)]
if opt.type == int:
valslist_ext = []
|