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
434ce25e
Commit
434ce25e
authored
Oct 27, 2023
by
comfyanonymous
Browse files
Restrict loading embeddings from embedding folders.
parent
40963b5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
comfy/sd1_clip.py
comfy/sd1_clip.py
+7
-1
No files found.
comfy/sd1_clip.py
View file @
434ce25e
...
@@ -278,7 +278,13 @@ def load_embed(embedding_name, embedding_directory, embedding_size, embed_key=No
...
@@ -278,7 +278,13 @@ def load_embed(embedding_name, embedding_directory, embedding_size, embed_key=No
valid_file
=
None
valid_file
=
None
for
embed_dir
in
embedding_directory
:
for
embed_dir
in
embedding_directory
:
embed_path
=
os
.
path
.
join
(
embed_dir
,
embedding_name
)
embed_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
embed_dir
,
embedding_name
))
embed_dir
=
os
.
path
.
abspath
(
embed_dir
)
try
:
if
os
.
path
.
commonpath
((
embed_dir
,
embed_path
))
!=
embed_dir
:
continue
except
:
continue
if
not
os
.
path
.
isfile
(
embed_path
):
if
not
os
.
path
.
isfile
(
embed_path
):
extensions
=
[
'.safetensors'
,
'.pt'
,
'.bin'
]
extensions
=
[
'.safetensors'
,
'.pt'
,
'.bin'
]
for
x
in
extensions
:
for
x
in
extensions
:
...
...
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