mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-05 19:12:41 +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
2adbbd6291
commit
f93e09a570
@ -1399,8 +1399,8 @@ class ModelPatcher:
|
|||||||
|
|
||||||
class ModelPatcherDynamic(ModelPatcher):
|
class ModelPatcherDynamic(ModelPatcher):
|
||||||
|
|
||||||
def __new__(cls, model, load_device, offload_device, size=0, weight_inplace_update=False):
|
def __new__(cls, model=None, load_device=None, offload_device=None, size=0, weight_inplace_update=False):
|
||||||
if comfy.model_management.is_device_cpu(load_device):
|
if load_device is not None and comfy.model_management.is_device_cpu(load_device):
|
||||||
#reroute to default MP for CPUs
|
#reroute to default MP for CPUs
|
||||||
return ModelPatcher(model, load_device, offload_device, size, weight_inplace_update)
|
return ModelPatcher(model, load_device, offload_device, size, weight_inplace_update)
|
||||||
return super().__new__(cls)
|
return super().__new__(cls)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user