Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
871a8659
"...composable_kernel_onnx.git" did not exist on "968bd93285318f0e43319d4c2a27c352a458ddd3"
Commit
871a8659
authored
Jun 02, 2023
by
comfyanonymous
Browse files
Smarter filename list caching.
parent
67892b5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
folder_paths.py
folder_paths.py
+4
-1
No files found.
folder_paths.py
View file @
871a8659
import
os
import
os
import
time
supported_ckpt_extensions
=
set
([
'.ckpt'
,
'.pth'
,
'.safetensors'
])
supported_ckpt_extensions
=
set
([
'.ckpt'
,
'.pth'
,
'.safetensors'
])
supported_pt_extensions
=
set
([
'.ckpt'
,
'.pt'
,
'.bin'
,
'.pth'
,
'.safetensors'
])
supported_pt_extensions
=
set
([
'.ckpt'
,
'.pt'
,
'.bin'
,
'.pth'
,
'.safetensors'
])
...
@@ -154,7 +155,7 @@ def get_filename_list_(folder_name):
...
@@ -154,7 +155,7 @@ def get_filename_list_(folder_name):
output_list
.
update
(
filter_files_extensions
(
files
,
folders
[
1
]))
output_list
.
update
(
filter_files_extensions
(
files
,
folders
[
1
]))
output_folders
=
{
**
output_folders
,
**
folders_all
}
output_folders
=
{
**
output_folders
,
**
folders_all
}
return
(
sorted
(
list
(
output_list
)),
output_folders
)
return
(
sorted
(
list
(
output_list
)),
output_folders
,
time
.
perf_counter
()
)
def
cached_filename_list_
(
folder_name
):
def
cached_filename_list_
(
folder_name
):
global
filename_list_cache
global
filename_list_cache
...
@@ -162,6 +163,8 @@ def cached_filename_list_(folder_name):
...
@@ -162,6 +163,8 @@ def cached_filename_list_(folder_name):
if
folder_name
not
in
filename_list_cache
:
if
folder_name
not
in
filename_list_cache
:
return
None
return
None
out
=
filename_list_cache
[
folder_name
]
out
=
filename_list_cache
[
folder_name
]
if
time
.
perf_counter
()
<
(
out
[
2
]
+
0.5
):
return
out
for
x
in
out
[
1
]:
for
x
in
out
[
1
]:
time_modified
=
out
[
1
][
x
]
time_modified
=
out
[
1
][
x
]
folder
=
x
folder
=
x
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment