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
6b774589
Commit
6b774589
authored
Jun 14, 2023
by
comfyanonymous
Browse files
Set model to fp16 before loading the state dict to lower ram bump.
parent
0c7cad40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
comfy/sd.py
comfy/sd.py
+2
-2
No files found.
comfy/sd.py
View file @
6b774589
...
@@ -1155,9 +1155,9 @@ def load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, o
...
@@ -1155,9 +1155,9 @@ def load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, o
else
:
else
:
model
=
model_base
.
BaseModel
(
unet_config
,
v_prediction
=
v_prediction
)
model
=
model_base
.
BaseModel
(
unet_config
,
v_prediction
=
v_prediction
)
model
=
load_model_weights
(
model
,
sd
,
verbose
=
False
,
load_state_dict_to
=
load_state_dict_to
)
if
fp16
:
if
fp16
:
model
=
model
.
half
()
model
=
model
.
half
()
model
=
load_model_weights
(
model
,
sd
,
verbose
=
False
,
load_state_dict_to
=
load_state_dict_to
)
return
(
ModelPatcher
(
model
),
clip
,
vae
,
clipvision
)
return
(
ModelPatcher
(
model
),
clip
,
vae
,
clipvision
)
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