fix region regex
This commit is contained in:
parent
1af6a75723
commit
df8b4abc77
|
@ -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]]:
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue