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
ca82ade7
Commit
ca82ade7
authored
Dec 04, 2023
by
comfyanonymous
Browse files
Use .itemsize to get dtype size for fp8.
parent
31b0f6f3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
comfy/model_management.py
comfy/model_management.py
+7
-0
No files found.
comfy/model_management.py
View file @
ca82ade7
...
...
@@ -430,6 +430,13 @@ def dtype_size(dtype):
dtype_size
=
4
if
dtype
==
torch
.
float16
or
dtype
==
torch
.
bfloat16
:
dtype_size
=
2
elif
dtype
==
torch
.
float32
:
dtype_size
=
4
else
:
try
:
dtype_size
=
dtype
.
itemsize
except
:
#Old pytorch doesn't have .itemsize
pass
return
dtype_size
def
unet_offload_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