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
2706c0b7
Commit
2706c0b7
authored
Jan 28, 2023
by
comfyanonymous
Browse files
Some VAEs come in .pt files.
parent
d133cf4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
nodes.py
nodes.py
+3
-1
No files found.
nodes.py
View file @
2706c0b7
...
@@ -17,9 +17,11 @@ import comfy.samplers
...
@@ -17,9 +17,11 @@ import comfy.samplers
import
comfy.sd
import
comfy.sd
supported_ckpt_extensions
=
[
'.ckpt'
]
supported_ckpt_extensions
=
[
'.ckpt'
]
supported_pt_extensions
=
[
'.ckpt'
,
'.pt'
]
try
:
try
:
import
safetensors.torch
import
safetensors.torch
supported_ckpt_extensions
+=
[
'.safetensors'
]
supported_ckpt_extensions
+=
[
'.safetensors'
]
supported_pt_extensions
+=
[
'.safetensors'
]
except
:
except
:
print
(
"Could not import safetensors, safetensors support disabled."
)
print
(
"Could not import safetensors, safetensors support disabled."
)
...
@@ -132,7 +134,7 @@ class VAELoader:
...
@@ -132,7 +134,7 @@ class VAELoader:
vae_dir
=
os
.
path
.
join
(
models_dir
,
"vae"
)
vae_dir
=
os
.
path
.
join
(
models_dir
,
"vae"
)
@
classmethod
@
classmethod
def
INPUT_TYPES
(
s
):
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"vae_name"
:
(
filter_files_extensions
(
os
.
listdir
(
s
.
vae_dir
),
supported_
ck
pt_extensions
),
)}}
return
{
"required"
:
{
"vae_name"
:
(
filter_files_extensions
(
os
.
listdir
(
s
.
vae_dir
),
supported_pt_extensions
),
)}}
RETURN_TYPES
=
(
"VAE"
,)
RETURN_TYPES
=
(
"VAE"
,)
FUNCTION
=
"load_vae"
FUNCTION
=
"load_vae"
...
...
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