ignore .vae file in model folder

pull/39/head
butaixianran 2023-03-11 12:38:18 +08:00
parent 9e849c6ab2
commit 104ccda276
2 changed files with 8 additions and 1 deletions

View File

@ -21,7 +21,7 @@ folders = {
exts = (".bin", ".pt", ".safetensors", ".ckpt") exts = (".bin", ".pt", ".safetensors", ".ckpt")
info_ext = ".info" info_ext = ".info"
vae_suffix = ".vae"
# get cusomter model path # get cusomter model path

View File

@ -24,6 +24,13 @@ def scan_model(max_size_preview, skip_nsfw_preview):
item = os.path.join(root, filename) item = os.path.join(root, filename)
base, ext = os.path.splitext(item) base, ext = os.path.splitext(item)
if ext in model.exts: if ext in model.exts:
# ignore vae file
if len(base) > 4:
if base[-4:] == model.vae_suffix:
# find .vae
util.printD("This is a vae file: " + filename)
continue
# find a model # find a model
# get info file # get info file
info_file = base + civitai.suffix + model.info_ext info_file = base + civitai.suffix + model.info_ext