mirror of
https://github.com/vladmandic/automatic
synced 2026-09-15 02:58:44 +02:00
update parser
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user