From 8edc25d35a10c1426a68273ebbb0665701e45aa5 Mon Sep 17 00:00:00 2001 From: brandonrising Date: Thu, 16 May 2024 13:47:05 -0400 Subject: [PATCH] Fix next node calling logic --- .../session_processor/session_processor_default.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/invokeai/app/services/session_processor/session_processor_default.py b/invokeai/app/services/session_processor/session_processor_default.py index eeb8df4cad..7f5a107b83 100644 --- a/invokeai/app/services/session_processor/session_processor_default.py +++ b/invokeai/app/services/session_processor/session_processor_default.py @@ -79,14 +79,10 @@ class DefaultSessionRunner(SessionRunnerBase): raise ValueError("Queue item has no session") invocation = None # Loop over invocations until the session is complete or canceled - while self.next_invocation(invocation, queue_item, self.cancel_event) and not self.cancel_event.is_set(): - # Prepare the next node - invocation = queue_item.session.next() - if invocation is None: - # If there are no more invocations, complete the graph - break - # Build invocation context (the node-facing API + invocation = self.next_invocation(invocation, queue_item, self.cancel_event) + while invocation is not None and not self.cancel_event.is_set(): self.run_node(invocation.id, queue_item) + invocation = self.next_invocation(invocation, queue_item, self.cancel_event) self.complete(queue_item) def complete(self, queue_item: SessionQueueItem):