mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 02:15:17 +00:00
Fix issue with some lowvram weights.
This commit is contained in:
parent
55ad9d5f8c
commit
5acdadc9f3
@ -393,10 +393,13 @@ class ModelPatcher:
|
|||||||
if m.comfy_cast_weights:
|
if m.comfy_cast_weights:
|
||||||
wipe_lowvram_weight(m)
|
wipe_lowvram_weight(m)
|
||||||
|
|
||||||
if hasattr(m, "weight"):
|
param = list(m.parameters())
|
||||||
|
if len(param) > 0:
|
||||||
mem_counter += comfy.model_management.module_size(m)
|
mem_counter += comfy.model_management.module_size(m)
|
||||||
if m.weight is not None and m.weight.device == device_to:
|
weight = param[0]
|
||||||
|
if weight.device == device_to:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
self.patch_weight_to_device(weight_key) #TODO: speed this up without OOM
|
self.patch_weight_to_device(weight_key) #TODO: speed this up without OOM
|
||||||
self.patch_weight_to_device(bias_key)
|
self.patch_weight_to_device(bias_key)
|
||||||
m.to(device_to)
|
m.to(device_to)
|
||||||
|
Loading…
Reference in New Issue
Block a user