mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-03-15 14:09:36 +00:00
Workaround for lora OOM on lowvram mode.
This commit is contained in:
parent
1208863eca
commit
cb7c4b4be3
@ -348,8 +348,8 @@ class ModelPatcher:
|
|||||||
m.comfy_cast_weights = True
|
m.comfy_cast_weights = True
|
||||||
else:
|
else:
|
||||||
if hasattr(m, "weight"):
|
if hasattr(m, "weight"):
|
||||||
self.patch_weight_to_device(weight_key, device_to)
|
self.patch_weight_to_device(weight_key) #TODO: speed this up without causing OOM
|
||||||
self.patch_weight_to_device(bias_key, device_to)
|
self.patch_weight_to_device(bias_key)
|
||||||
m.to(device_to)
|
m.to(device_to)
|
||||||
mem_counter += comfy.model_management.module_size(m)
|
mem_counter += comfy.model_management.module_size(m)
|
||||||
logging.debug("lowvram: loaded module regularly {} {}".format(n, m))
|
logging.debug("lowvram: loaded module regularly {} {}".format(n, m))
|
||||||
|
Loading…
Reference in New Issue
Block a user