From 1a57423d30da06283dd20a7aee2aadcb58c37e59 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Wed, 10 Jan 2024 04:00:49 -0500 Subject: [PATCH] Fix issue when using multiple t2i adapters with batched images. --- comfy/controlnet.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/comfy/controlnet.py b/comfy/controlnet.py index 8404054f..df474201 100644 --- a/comfy/controlnet.py +++ b/comfy/controlnet.py @@ -126,7 +126,10 @@ class ControlBase: if o[i] is None: o[i] = prev_val else: - o[i] += prev_val + if o[i].shape[0] < prev_val.shape[0]: + o[i] = prev_val + o[i] + else: + o[i] += prev_val return out class ControlNet(ControlBase):