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
12e822c6
Commit
12e822c6
authored
Dec 28, 2023
by
comfyanonymous
Browse files
Use function to calculate model size in model patcher.
parent
e1e322cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
comfy/model_patcher.py
comfy/model_patcher.py
+2
-6
No files found.
comfy/model_patcher.py
View file @
12e822c6
...
...
@@ -28,13 +28,9 @@ class ModelPatcher:
if
self
.
size
>
0
:
return
self
.
size
model_sd
=
self
.
model
.
state_dict
()
size
=
0
for
k
in
model_sd
:
t
=
model_sd
[
k
]
size
+=
t
.
nelement
()
*
t
.
element_size
()
self
.
size
=
size
self
.
size
=
comfy
.
model_management
.
module_size
(
self
.
model
)
self
.
model_keys
=
set
(
model_sd
.
keys
())
return
size
return
self
.
size
def
clone
(
self
):
n
=
ModelPatcher
(
self
.
model
,
self
.
load_device
,
self
.
offload_device
,
self
.
size
,
self
.
current_device
,
weight_inplace_update
=
self
.
weight_inplace_update
)
...
...
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