From b32e82730e38f40cde70badc0c943699f5ce591d Mon Sep 17 00:00:00 2001 From: xmarre Date: Tue, 31 Mar 2026 22:53:39 +0200 Subject: [PATCH] Make forecast row assignment transactional --- comfyui_spectrum/runtime.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/comfyui_spectrum/runtime.py b/comfyui_spectrum/runtime.py index 1a85545..bd3cf5d 100644 --- a/comfyui_spectrum/runtime.py +++ b/comfyui_spectrum/runtime.py @@ -403,13 +403,18 @@ class SpectrumRuntime: return None if step.prediction_row_positions is None: step.prediction_row_positions = self._build_label_positions(self._history_batch_labels) + trial_positions = { + label: deque(position_list) + for label, position_list in step.prediction_row_positions.items() + } order = [] for label in target_batch_labels: - positions = step.prediction_row_positions.get(label) + positions = trial_positions.get(label) if not positions: return None order.append(positions.popleft()) + step.prediction_row_positions = trial_positions prediction_rows = tuple(order) step.call_prediction_rows[resolved_call_id] = prediction_rows return prediction_rows