Refactor module_size function. (#11637)

This commit is contained in:
comfyanonymous
2026-01-05 00:48:31 -08:00
committed by GitHub
parent d1b9822f74
commit d157c3299d

View File

@@ -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: