mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
fix: avoid error parse unknown value
This commit is contained in:
parent
9af67abfcf
commit
d2d6ea2f60
@ -268,6 +268,8 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
|
|||||||
|
|
||||||
for k, v in re_param.findall(lastline):
|
for k, v in re_param.findall(lastline):
|
||||||
try:
|
try:
|
||||||
|
v = v.strip()
|
||||||
|
|
||||||
if v.startswith('"') and v.endswith('"'):
|
if v.startswith('"') and v.endswith('"'):
|
||||||
v = unquote(v)
|
v = unquote(v)
|
||||||
elif v.startswith('[') and v.endswith(']'):
|
elif v.startswith('[') and v.endswith(']'):
|
||||||
@ -280,12 +282,12 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
|
|||||||
res[f"{k}-1"] = m.group(1)
|
res[f"{k}-1"] = m.group(1)
|
||||||
res[f"{k}-2"] = m.group(2)
|
res[f"{k}-2"] = m.group(2)
|
||||||
continue
|
continue
|
||||||
v = v.strip() # Remove surrounding spaces for non-JSON values
|
|
||||||
|
|
||||||
res[k] = v
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error parsing \"{k}: {v}\": {e}")
|
print(f"Error parsing \"{k}: {v}\": {e}")
|
||||||
|
|
||||||
|
res[k] = v
|
||||||
|
|
||||||
# Extract styles from prompt
|
# Extract styles from prompt
|
||||||
if shared.opts.infotext_styles != "Ignore":
|
if shared.opts.infotext_styles != "Ignore":
|
||||||
found_styles, prompt_no_styles, negative_prompt_no_styles = shared.prompt_styles.extract_styles_from_prompt(prompt, negative_prompt)
|
found_styles, prompt_no_styles, negative_prompt_no_styles = shared.prompt_styles.extract_styles_from_prompt(prompt, negative_prompt)
|
||||||
|
Loading…
Reference in New Issue
Block a user