From a82fae2375744a73d63268bc4e167649e3f026e0 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 10 Jun 2024 16:00:03 -0400 Subject: [PATCH] Fix bug with cosxl edit model. --- comfy/conds.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/comfy/conds.py b/comfy/conds.py index 23fa48872d6..660690af842 100644 --- a/comfy/conds.py +++ b/comfy/conds.py @@ -29,7 +29,12 @@ def concat(self, others): class CONDNoiseShape(CONDRegular): def process_cond(self, batch_size, device, area, **kwargs): - data = self.cond[:,:,area[2]:area[0] + area[2],area[3]:area[1] + area[3]] + data = self.cond + if area is not None: + dims = len(area) // 2 + for i in range(dims): + data = data.narrow(i + 2, area[i + dims], area[i]) + return self._copy_with(comfy.utils.repeat_to_batch_size(data, batch_size).to(device))