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
58ed0f2d
Commit
58ed0f2d
authored
Apr 07, 2023
by
comfyanonymous
Browse files
Fix loading SD1.5 diffusers checkpoint.
parent
8b9ac8fe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
comfy/diffusers_convert.py
comfy/diffusers_convert.py
+3
-1
nodes.py
nodes.py
+2
-2
No files found.
comfy/diffusers_convert.py
View file @
58ed0f2d
...
...
@@ -272,6 +272,7 @@ def load_diffusers(model_path, fp16=True, output_vae=True, output_clip=True, emb
# magic
v2
=
diffusers_unet_conf
[
"sample_size"
]
==
96
if
'prediction_type'
in
diffusers_scheduler_conf
:
v_pred
=
diffusers_scheduler_conf
[
'prediction_type'
]
==
'v_prediction'
if
v2
:
...
...
@@ -290,6 +291,7 @@ def load_diffusers(model_path, fp16=True, output_vae=True, output_clip=True, emb
scale_factor
=
model_config_params
[
'scale_factor'
]
vae_config
=
model_config_params
[
'first_stage_config'
]
vae_config
[
'scale_factor'
]
=
scale_factor
model_config_params
[
"unet_config"
][
"params"
][
"use_fp16"
]
=
fp16
unet_path
=
osp
.
join
(
model_path
,
"unet"
,
"diffusion_pytorch_model.safetensors"
)
vae_path
=
osp
.
join
(
model_path
,
"vae"
,
"diffusion_pytorch_model.safetensors"
)
...
...
nodes.py
View file @
58ed0f2d
...
...
@@ -231,7 +231,7 @@ class DiffusersLoader:
RETURN_TYPES
=
(
"MODEL"
,
"CLIP"
,
"VAE"
)
FUNCTION
=
"load_checkpoint"
CATEGORY
=
"loaders"
CATEGORY
=
"
advanced/
loaders"
def
load_checkpoint
(
self
,
model_path
,
output_vae
=
True
,
output_clip
=
True
):
for
search_path
in
folder_paths
.
get_folder_paths
(
"diffusers"
):
...
...
@@ -240,7 +240,7 @@ class DiffusersLoader:
if
model_path
in
paths
:
model_path
=
os
.
path
.
join
(
search_path
,
model_path
)
break
search_paths
=
folder_paths
.
get_folder_paths
(
"diffusers"
)
return
load_diffusers
(
model_path
,
fp16
=
model_management
.
should_use_fp16
(),
output_vae
=
output_vae
,
output_clip
=
output_clip
,
embedding_directory
=
folder_paths
.
get_folder_paths
(
"embeddings"
))
...
...
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