From f93e09a570ee287f1c03cf633edb5ed953e8fe7f Mon Sep 17 00:00:00 2001 From: Rattus Date: Tue, 20 Jan 2026 22:02:58 +1000 Subject: [PATCH] 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. --- comfy/model_patcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py index b30a9c63d..2f9be07d8 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -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)