Skip to content

Commit 17a3a04

Browse files
brandonrisingpsychedelicious
authored andcommitted
Fix next node calling logic
1 parent fb6ba54 commit 17a3a04

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
@@ -79,14 +79,10 @@ def run(self, queue_item: SessionQueueItem):
7979
raise ValueError("Queue item has no session")
8080
invocation = None
8181
# Loop over invocations until the session is complete or canceled
82-
while self.next_invocation(invocation, queue_item, self.cancel_event) and not self.cancel_event.is_set():
83-
# Prepare the next node
84-
invocation = queue_item.session.next()
85-
if invocation is None:
86-
# If there are no more invocations, complete the graph
87-
break
88-
# Build invocation context (the node-facing API
82+
invocation = self.next_invocation(invocation, queue_item, self.cancel_event)
83+
while invocation is not None and not self.cancel_event.is_set():
8984
self.run_node(invocation.id, queue_item)
85+
invocation = self.next_invocation(invocation, queue_item, self.cancel_event)
9086
self.complete(queue_item)
9187

9288
def complete(self, queue_item: SessionQueueItem):

0 commit comments

Comments
 (0)