1
0
Fork 0

fix region regex

This commit is contained in:
Sean Sube 2023-11-05 17:46:28 -06:00
parent 1af6a75723
commit df8b4abc77
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 16 additions and 3 deletions

View File

@ -21,7 +21,7 @@ CLIP_TOKEN = compile(r"\<clip:([-\w]+):(\d+)\>")
INVERSION_TOKEN = compile(r"\<inversion:([^:\>]+):(-?[\.|\d]+)\>")
LORA_TOKEN = compile(r"\<lora:([^:\>]+):(-?[\.|\d]+)\>")
WILDCARD_TOKEN = compile(r"__([-/\\\w]+)__")
REGION_TOKEN = compile(r"\<region:(\d+):(\d+):(\d+):(\d+):(add|replace):([^\>]+)\>")
REGION_TOKEN = compile(r"\<region:(\d+):(\d+):(\d+):(\d+):(-?[\.|\d]+):([^\>]+)\>")
INTERVAL_RANGE = compile(r"(\w+)-{(\d+),(\d+)(?:,(\d+))?}")
ALTERNATIVE_RANGE = compile(r"\(([^\)]+)\)")
@ -459,8 +459,8 @@ Region = Tuple[int, int, int, int, float, str]
def parse_region_group(group) -> Region:
top, left, bottom, right, mode, prompt = group
return (int(top), int(left), int(bottom), int(right), float(mode), prompt)
top, left, bottom, right, mult, prompt = group
return (int(top), int(left), int(bottom), int(right), float(mult), prompt)
def parse_regions(prompt: str) -> Tuple[str, List[Region]]:

13
run/onnx-web.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=onnx-web server
After=network.target
[Service]
Type=simple
# EnvironmentFile=/path/to/your/env
ExecStart=/opt/onnx-web/api/launch.sh
ExecStop=/bin/kill -WINCH ${MAINPID}
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target