fix wildcard scripts to work on windows
This commit is contained in:
parent
ae6166aaf9
commit
5ecc874c70
|
@ -20,7 +20,7 @@ MAX_TOKENS_PER_GROUP = 77
|
|||
CLIP_TOKEN = compile(r"\<clip:([-\w]+):(\d+)\>")
|
||||
INVERSION_TOKEN = compile(r"\<inversion:([^:\>]+):(-?[\.|\d]+)\>")
|
||||
LORA_TOKEN = compile(r"\<lora:([^:\>]+):(-?[\.|\d]+)\>")
|
||||
WILDCARD_TOKEN = compile(r"__([-/\w]+)__")
|
||||
WILDCARD_TOKEN = compile(r"__([-/\\\w]+)__")
|
||||
|
||||
INTERVAL_RANGE = compile(r"(\w+)-{(\d+),(\d+)(?:,(\d+))?}")
|
||||
ALTERNATIVE_RANGE = compile(r"\(([^\)]+)\)")
|
||||
|
|
|
@ -474,7 +474,7 @@ def load_wildcards(server: ServerContext) -> None:
|
|||
)
|
||||
|
||||
for file in wildcard_files:
|
||||
with open(path.join(server.model_path, "wildcard", f"{file}.txt"), "r") as f:
|
||||
with open(path.join(server.model_path, "wildcard", file), "r", encoding="utf-8") as f:
|
||||
lines = f.read().splitlines()
|
||||
lines = [line.strip() for line in lines if not line.startswith("#")]
|
||||
lines = [line for line in lines if len(line) > 0]
|
||||
|
|
Loading…
Reference in New Issue