From dff03e5218b5c8245270c96da05b41b8859d1ec8 Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Sun, 1 Dec 2024 21:25:39 -0600 Subject: [PATCH] Made finalize_default_conds area math consistent with other sampling code --- comfy/samplers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/comfy/samplers.py b/comfy/samplers.py index 3a90a54c8..b4c42160d 100644 --- a/comfy/samplers.py +++ b/comfy/samplers.py @@ -162,7 +162,11 @@ def finalize_default_conds(model: 'BaseModel', hooked_to_run: dict[comfy.hooks.H continue area: list[int] = cond_obj.area if area is not None: - default_mults[i][:,:,area[2]:area[0] + area[2],area[3]:area[1] + area[3]] -= cond_obj.mult + curr_default_mult: torch.Tensor = default_mults[i] + dims = len(area) // 2 + for i in range(dims): + curr_default_mult = curr_default_mult.narrow(i + 2, area[i + dims], area[i]) + curr_default_mult -= cond_obj.mult else: default_mults[i] -= cond_obj.mult # for each default_mult, ReLU to make negatives=0, and then check for any nonzeros