From fb99aa0a655e9a6ed68f00b3389a88fcc11b220e Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 28 Nov 2025 09:38:24 -0300 Subject: [PATCH] [ConsolidateMetrics][Fixed] n_metric_ids must match n_destination Also avoid trying to consolidate empty data --- src/nodes/nodes_img.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nodes/nodes_img.py b/src/nodes/nodes_img.py index 449502d..8fd62ad 100644 --- a/src/nodes/nodes_img.py +++ b/src/nodes/nodes_img.py @@ -1115,8 +1115,8 @@ class ConsolidateMetrics(ComfyNodeABC): raise ValueError(f"Got {n_metrics} metrics and {n_destination} destinations. They must be multiples.") if n_res_destination > 1: raise ValueError(f"Only one resume destination currently supported, got {n_res_destination}") - if n_res_destination and n_metric_ids != n_metrics: - raise ValueError(f"Got {n_metrics} metrics and {n_metric_ids} metric IDs. They must match.") + if n_res_destination and n_metric_ids != n_destination: + raise ValueError(f"Got {n_destination} destinations and {n_metric_ids} metric IDs. They must match.") slice_size = n_metrics // n_destination res = [] @@ -1126,7 +1126,7 @@ class ConsolidateMetrics(ComfyNodeABC): end = start + slice_size data, total = self.consolidate(metrics[start:end], img_name[start:end], d) res.append(data) - if n_res_destination: + if n_res_destination and total: totals[metric_ids[c]] = total if totals: