Skip to content

Commit f9a1225

Browse files
authored
Merge pull request #236 from Kosinkadink/develop
Fix other ControlNet types after recent ComfyUI controlnet change
2 parents b1f358c + 86bfde7 commit f9a1225

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

adv_control/control.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def get_control_advanced(self, x_noisy, t, cond, batched_number, transformer_opt
333333
if cond.get('c_concat', None) is not None:
334334
x_noisy = torch.cat([x_noisy] + [cond['c_concat']], dim=1)
335335

336-
control = self.control_model(x=x_noisy.to(dtype), hint=self.cond_hint, timesteps=timestep.float(), context=context.to(dtype), y=y, cond=cond)
336+
control = self.control_model(x=x_noisy.to(dtype), hint=self.cond_hint, timesteps=timestep.float(), context=comfy.model_management.cast_to_device(context, x_noisy.device, dtype), y=y, cond=cond)
337337
return self.control_merge(control, control_prev, output_dtype)
338338

339339
def copy(self):
@@ -463,7 +463,7 @@ def get_control_advanced(self, x_noisy: Tensor, t, cond, batched_number: int, tr
463463
timestep = self.model_sampling_current.timestep(t)
464464
x_noisy = self.model_sampling_current.calculate_input(t, x_noisy)
465465

466-
control = self.control_model(x=x_noisy.to(dtype), hint=self.cond_hint, timesteps=timestep.float(), context=context.to(dtype), y=y)
466+
control = self.control_model(x=x_noisy.to(dtype), hint=self.cond_hint, timesteps=timestep.float(), context=comfy.model_management.cast_to_device(context, x_noisy.device, dtype), y=y)
467467
return self.control_merge(control, control_prev, output_dtype)
468468

469469
def apply_advanced_strengths_and_masks(self, x: Tensor, batched_number: int, *args, **kwargs):

adv_control/control_plusplus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def get_control_advanced(self, x_noisy: Tensor, t, cond, batched_number, transfo
343343
timestep = self.model_sampling_current.timestep(t)
344344
x_noisy = self.model_sampling_current.calculate_input(t, x_noisy)
345345

346-
control = self.control_model(x=x_noisy.to(dtype), hint=self.cond_hint, timesteps=timestep.float(), context=context.to(dtype), y=y, control_type=self.cond_hint_types)
346+
control = self.control_model(x=x_noisy.to(dtype), hint=self.cond_hint, timesteps=timestep.float(), context=comfy.model_management.cast_to_device(context, x_noisy.device, dtype), y=y, control_type=self.cond_hint_types)
347347
return self.control_merge(control, control_prev, output_dtype)
348348

349349
def copy(self):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "comfyui-advanced-controlnet"
33
description = "Nodes for scheduling ControlNet strength across timesteps and batched latents, as well as applying custom weights and attention masks."
4-
version = "1.5.4"
4+
version = "1.5.5"
55
license = { file = "LICENSE" }
66
dependencies = []
77

0 commit comments

Comments
 (0)