install model if diffusers or single file, cleaned up backend logic to not mess with existing model install

This commit is contained in:
Jennifer Player
2024-03-11 08:42:04 -04:00
committed by psychedelicious
parent 4c0896e436
commit 3a5314f1ca
4 changed files with 63 additions and 24 deletions

View File

@ -51,15 +51,7 @@ def filter_files(
(
"learned_embeds.bin",
"ip_adapter.bin",
# jennifer added a bunch of these, probably will break something
".safetensors",
".bin",
".onnx",
".xml",
".pth",
".pt",
".ckpt",
".msgpack",
"lora_weights.safetensors",
"weights.pb",
"onnx_data",
)
@ -79,8 +71,7 @@ def filter_files(
paths = [x for x in paths if x.parent == Path(subfolder)]
# _filter_by_variant uniquifies the paths and returns a set
# jennifer removed the filter since it removed models, probably will break something but i dont understand why it removes valid models :|
return sorted(paths)
return sorted(_filter_by_variant(paths, variant))
@dataclass