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
af9cc1fb
Commit
af9cc1fb
authored
May 05, 2023
by
comfyanonymous
Browse files
Search recursively in subfolders for embeddings.
parent
6ee11d7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
comfy/sd1_clip.py
comfy/sd1_clip.py
+9
-0
No files found.
comfy/sd1_clip.py
View file @
af9cc1fb
...
...
@@ -191,11 +191,20 @@ def safe_load_embed_zip(embed_path):
del
embed
return
out
def
expand_directory_list
(
directories
):
dirs
=
set
()
for
x
in
directories
:
dirs
.
add
(
x
)
for
root
,
subdir
,
file
in
os
.
walk
(
x
,
followlinks
=
True
):
dirs
.
add
(
root
)
return
list
(
dirs
)
def
load_embed
(
embedding_name
,
embedding_directory
):
if
isinstance
(
embedding_directory
,
str
):
embedding_directory
=
[
embedding_directory
]
embedding_directory
=
expand_directory_list
(
embedding_directory
)
valid_file
=
None
for
embed_dir
in
embedding_directory
:
embed_path
=
os
.
path
.
join
(
embed_dir
,
embedding_name
)
...
...
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