From 82fa78537655f504b0926097b0e5188df795d612 Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Wed, 1 Nov 2023 03:05:17 -0500 Subject: [PATCH] Fixed control.py to work properly with ComfyUI updates --- control/control.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/control/control.py b/control/control.py index d3f07da..18fff63 100644 --- a/control/control.py +++ b/control/control.py @@ -235,7 +235,10 @@ class ControlNetAdvanced(ControlNet): y = cond.get('c_adm', None) if y is not None: y = y.to(self.control_model.dtype) - control = self.control_model(x=x_noisy.to(self.control_model.dtype), hint=self.cond_hint, timesteps=t, context=context.to(self.control_model.dtype), y=y) + timestep = self.model_sampling_current.timestep(t) + x_noisy = self.model_sampling_current.calculate_input(t, x_noisy) + + control = self.control_model(x=x_noisy.to(self.control_model.dtype), hint=self.cond_hint, timesteps=timestep.float(), context=context.to(self.control_model.dtype), y=y) return self.control_merge(None, control, control_prev, output_dtype) def apply_advanced_strengths_and_masks(self, x: Tensor, current_timestep_keyframe: TimestepKeyframe, batched_number: int):