From 79f8a8aa8bef2286f1dd90af7a4e664d42bc22e5 Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Wed, 6 Aug 2025 12:59:25 -0700 Subject: [PATCH 1/2] Fixed device mismatch issue for ControlNet++, SparseCtrl, and SVDControlNet --- adv_control/control.py | 4 ++-- adv_control/control_plusplus.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/adv_control/control.py b/adv_control/control.py index c15fd17..eb71b0f 100644 --- a/adv_control/control.py +++ b/adv_control/control.py @@ -326,7 +326,7 @@ class SVDControlNetAdvanced(ControlNetAdvanced): # uses 'y' in new ComfyUI update y = cond.get('y', None) if y is not None: - y = y.to(dtype) + y = comfy.model_base.convert_tensor(y, dtype, x_noisy.device) timestep = self.model_sampling_current.timestep(t) x_noisy = self.model_sampling_current.calculate_input(t, x_noisy) # concat c_concat if exists (should exist for SVD), doubling channels to 8 @@ -459,7 +459,7 @@ class SparseCtrlAdvanced(ControlNetAdvanced): context = cond['c_crossattn'] y = cond.get('y', None) if y is not None: - y = y.to(dtype) + y = comfy.model_base.convert_tensor(y, dtype, x_noisy.device) timestep = self.model_sampling_current.timestep(t) x_noisy = self.model_sampling_current.calculate_input(t, x_noisy) diff --git a/adv_control/control_plusplus.py b/adv_control/control_plusplus.py index 3f984b6..25cb705 100644 --- a/adv_control/control_plusplus.py +++ b/adv_control/control_plusplus.py @@ -18,6 +18,7 @@ from comfy.controlnet import ControlNet #from comfy.t2i_adapter.adapter import ResidualAttentionBlock from comfy.ldm.modules.attention import optimized_attention import comfy.ops +import comfy.model_base import comfy.model_management import comfy.model_detection import comfy.utils @@ -339,7 +340,7 @@ class ControlNetPlusPlusAdvanced(ControlNet, AdvancedControlBase): context = cond.get('crossattn_controlnet', cond['c_crossattn']) y = cond.get('y', None) if y is not None: - y = y.to(dtype) + y = comfy.model_base.convert_tensor(y, dtype, x_noisy.device) timestep = self.model_sampling_current.timestep(t) x_noisy = self.model_sampling_current.calculate_input(t, x_noisy) From c0b5d7378bc2c526c5f66c347471ea66f69d1065 Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Wed, 6 Aug 2025 12:59:40 -0700 Subject: [PATCH 2/2] version bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 27bd14e..0dd2feb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-advanced-controlnet" description = "Nodes for scheduling ControlNet strength across timesteps and batched latents, as well as applying custom weights and attention masks." -version = "1.5.5" +version = "1.5.6" license = { file = "LICENSE" } dependencies = []