Skip to content

Commit

Permalink
uses autos new regex, checks len of re_param
Browse files Browse the repository at this point in the history
  • Loading branch information
EllangoK committed Jan 28, 2023
1 parent 4d634dc commit 591b68e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/generation_parameters_copypaste.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import tempfile
from PIL import Image

re_param_code = r'\s*([\w ]+):\s*(\"[^\"]*\"|[^,]+)'
re_param_code = r'\s*([\w ]+):\s*("(?:\\"[^,]|\\"|\\|[^\"])+"|[^,]*)(?:,|$)'
re_param = re.compile(re_param_code)
re_imagesize = re.compile(r"^(\d+)x(\d+)$")
re_hypernet_hash = re.compile("\(([0-9a-f]+)\)$")
Expand Down Expand Up @@ -242,7 +242,7 @@ def parse_generation_parameters(x: str):
done_with_prompt = False

*lines, lastline = x.strip().split("\n")
if not re_param.match(lastline):
if len(re_param.findall(lastline)) < 3:
lines.append(lastline)
lastline = ''

Expand Down

0 comments on commit 591b68e

Please sign in to comment.