mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Ignore safetensor or ckpt files inside diffusers model folders.
Basically skips the path if the path has the word diffusers anywhere inside it.
This commit is contained in:
parent
310501cd8a
commit
7f695fed39
@ -799,15 +799,17 @@ class ModelManager(object):
|
||||
models_folder_safetensors = Path(search_folder).glob("**/*.safetensors")
|
||||
|
||||
ckpt_files = [x for x in models_folder_ckpt if x.is_file()]
|
||||
safetensor_files = [x for x in models_folder_safetensors if x.is_file]
|
||||
safetensor_files = [x for x in models_folder_safetensors if x.is_file()]
|
||||
|
||||
files = ckpt_files + safetensor_files
|
||||
|
||||
found_models = []
|
||||
for file in files:
|
||||
found_models.append(
|
||||
{"name": file.stem, "location": str(file.resolve()).replace("\\", "/")}
|
||||
)
|
||||
location = str(file.resolve()).replace("\\", "/")
|
||||
if 'diffusers' not in location:
|
||||
found_models.append(
|
||||
{"name": file.stem, "location": location}
|
||||
)
|
||||
|
||||
return search_folder, found_models
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user