Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Refactor module_size function. (#11637)

comfyanonymousd157c3299d6f
diff --git a/comfy/model_management.py b/comfy/model_management.py
index 2501cecb7..7f5a8aee9 100644
--- a/comfy/model_management.py
+++ b/comfy/model_management.py
@@ -456,7 +456,7 @@ def module_size(module):
sd = module.state_dict()
for k in sd:
t = sd[k]
- module_mem += t.nelement() * t.element_size()
+ module_mem += t.nbytes
return module_mem
class LoadedModel: