mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-02 09:40:19 +08:00
mp: handle blank __new__ call
This is needed for deepcopy construction. We shouldnt really have deep copies of MP or MODynamic however this is a stay one in some controlnet flows.
This commit is contained in:
parent
7f706a01d6
commit
b915d13e57
@ -1399,8 +1399,8 @@ class ModelPatcher:
|
||||
|
||||
class ModelPatcherDynamic(ModelPatcher):
|
||||
|
||||
def __new__(cls, model, load_device, offload_device, size=0, weight_inplace_update=False):
|
||||
if comfy.model_management.is_device_cpu(load_device):
|
||||
def __new__(cls, model=None, load_device=None, offload_device=None, size=0, weight_inplace_update=False):
|
||||
if load_device is not None and comfy.model_management.is_device_cpu(load_device):
|
||||
#reroute to default MP for CPUs
|
||||
return ModelPatcher(model, load_device, offload_device, size, weight_inplace_update)
|
||||
return super().__new__(cls)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user