From 527dc0eedf209f29cf9380a8d925b520cc3d4878 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 18 May 2023 19:46:11 -0400 Subject: [PATCH] update parser --- modules/progress.py | 2 +- modules/prompt_parser.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/progress.py b/modules/progress.py index 42ed01052..09e282353 100644 --- a/modules/progress.py +++ b/modules/progress.py @@ -62,7 +62,7 @@ def progressapi(req: ProgressRequest): queued = req.id_task in pending_tasks completed = req.id_task in finished_tasks if not active: - return ProgressResponse(active=active, queued=queued, completed=completed, id_live_preview=-1, textinfo="In queue..." if queued else "Waiting...") + return ProgressResponse(active=active, queued=queued, completed=completed, id_live_preview=-1, textinfo="Queued..." if queued else "Waiting...") progress = 0 job_count, job_no = shared.state.job_count, shared.state.job_no sampling_steps, sampling_step = shared.state.sampling_steps, shared.state.sampling_step diff --git a/modules/prompt_parser.py b/modules/prompt_parser.py index c9a4faeb6..bfcf314db 100644 --- a/modules/prompt_parser.py +++ b/modules/prompt_parser.py @@ -317,6 +317,7 @@ def parse_prompt_attention(text): for m in re_attention.finditer(text): text = m.group(0) weight = m.group(1) + if text.startswith('\\'): res.append([text[1:], 1.0]) elif text == '(': @@ -326,7 +327,8 @@ def parse_prompt_attention(text): elif weight is not None and len(round_brackets) > 0: multiply_range(round_brackets.pop(), float(weight)) elif weight is not None and len(square_brackets) > 0: - multiply_range(square_brackets.pop(), float(weight)) + if opts.prompt_attention == 'Full parser': + multiply_range(square_brackets.pop(), float(weight)) elif text == ')' and len(round_brackets) > 0: multiply_range(round_brackets.pop(), round_bracket_multiplier) elif text == ']' and len(square_brackets) > 0: