Skip to content

Commit 4fac432

Browse files
committed
Fix next node calling logic
1 parent eb16a3e commit 4fac432

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

invokeai/app/services/session_processor/session_processor_default.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,10 @@ def run(self, queue_item: SessionQueueItem):
7777
raise ValueError("Queue item has no session")
7878
invocation = None
7979
# Loop over invocations until the session is complete or canceled
80-
while self.next_invocation(invocation, queue_item, self.cancel_event) and not self.cancel_event.is_set():
81-
# Prepare the next node
82-
invocation = queue_item.session.next()
83-
if invocation is None:
84-
# If there are no more invocations, complete the graph
85-
break
86-
# Build invocation context (the node-facing API
80+
invocation = self.next_invocation(invocation, queue_item, self.cancel_event)
81+
while invocation is not None and not self.cancel_event.is_set():
8782
self.run_node(invocation.id, queue_item)
83+
invocation = self.next_invocation(invocation, queue_item, self.cancel_event)
8884
self.complete(queue_item)
8985

9086
def complete(self, queue_item: SessionQueueItem):

0 commit comments

Comments
 (0)