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
00a9189e
Commit
00a9189e
authored
Feb 19, 2023
by
comfyanonymous
Browse files
Support old pytorch.
parent
191af3ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
comfy/sd1_clip.py
comfy/sd1_clip.py
+4
-1
No files found.
comfy/sd1_clip.py
View file @
00a9189e
...
@@ -186,7 +186,10 @@ def load_embed(embedding_name, embedding_directory):
...
@@ -186,7 +186,10 @@ def load_embed(embedding_name, embedding_directory):
import
safetensors.torch
import
safetensors.torch
embed
=
safetensors
.
torch
.
load_file
(
embed_path
,
device
=
"cpu"
)
embed
=
safetensors
.
torch
.
load_file
(
embed_path
,
device
=
"cpu"
)
else
:
else
:
embed
=
torch
.
load
(
embed_path
,
weights_only
=
True
,
map_location
=
"cpu"
)
if
'weights_only'
in
torch
.
load
.
__code__
.
co_varnames
:
embed
=
torch
.
load
(
embed_path
,
weights_only
=
True
,
map_location
=
"cpu"
)
else
:
embed
=
torch
.
load
(
embed_path
,
map_location
=
"cpu"
)
if
'string_to_param'
in
embed
:
if
'string_to_param'
in
embed
:
values
=
embed
[
'string_to_param'
].
values
()
values
=
embed
[
'string_to_param'
].
values
()
else
:
else
:
...
...
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