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
824e4935
"...git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "6fcc2e715059ee99ca580d19b505800f1d746c67"
Commit
824e4935
authored
Dec 12, 2023
by
comfyanonymous
Browse files
Add dtype parameter to VAE object.
parent
32b7e7e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
comfy/sd.py
comfy/sd.py
+4
-2
No files found.
comfy/sd.py
View file @
824e4935
...
@@ -151,7 +151,7 @@ class CLIP:
...
@@ -151,7 +151,7 @@ class CLIP:
return
self
.
patcher
.
get_key_patches
()
return
self
.
patcher
.
get_key_patches
()
class
VAE
:
class
VAE
:
def
__init__
(
self
,
sd
=
None
,
device
=
None
,
config
=
None
):
def
__init__
(
self
,
sd
=
None
,
device
=
None
,
config
=
None
,
dtype
=
None
):
if
'decoder.up_blocks.0.resnets.0.norm1.weight'
in
sd
.
keys
():
#diffusers format
if
'decoder.up_blocks.0.resnets.0.norm1.weight'
in
sd
.
keys
():
#diffusers format
sd
=
diffusers_convert
.
convert_vae_state_dict
(
sd
)
sd
=
diffusers_convert
.
convert_vae_state_dict
(
sd
)
...
@@ -188,7 +188,9 @@ class VAE:
...
@@ -188,7 +188,9 @@ class VAE:
device
=
model_management
.
vae_device
()
device
=
model_management
.
vae_device
()
self
.
device
=
device
self
.
device
=
device
offload_device
=
model_management
.
vae_offload_device
()
offload_device
=
model_management
.
vae_offload_device
()
self
.
vae_dtype
=
model_management
.
vae_dtype
()
if
dtype
is
None
:
dtype
=
model_management
.
vae_dtype
()
self
.
vae_dtype
=
dtype
self
.
first_stage_model
.
to
(
self
.
vae_dtype
)
self
.
first_stage_model
.
to
(
self
.
vae_dtype
)
self
.
output_device
=
model_management
.
intermediate_device
()
self
.
output_device
=
model_management
.
intermediate_device
()
...
...
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