Skip to content

Commit 5acdadc

Browse files
Fix issue with some lowvram weights.
1 parent 55ad9d5 commit 5acdadc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

comfy/model_patcher.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,13 @@ def lowvram_load(self, device_to=None, lowvram_model_memory=0, force_patch_weigh
393393
if m.comfy_cast_weights:
394394
wipe_lowvram_weight(m)
395395

396-
if hasattr(m, "weight"):
396+
param = list(m.parameters())
397+
if len(param) > 0:
397398
mem_counter += comfy.model_management.module_size(m)
398-
if m.weight is not None and m.weight.device == device_to:
399+
weight = param[0]
400+
if weight.device == device_to:
399401
continue
402+
400403
self.patch_weight_to_device(weight_key) #TODO: speed this up without OOM
401404
self.patch_weight_to_device(bias_key)
402405
m.to(device_to)

0 commit comments

Comments
 (0)