Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(execution): propagate compatibility skips

JPPhotoa0076421cdfb
diff --git a/invokeai/app/services/shared/README.md b/invokeai/app/services/shared/README.md
index e0558e7e4d..ca194d90e1 100644
--- a/invokeai/app/services/shared/README.md
+++ b/invokeai/app/services/shared/README.md
@@ -230,11 +230,15 @@ interactions.
The test-only differential harness at
`tests/app/services/shared/test_execution_engine_differential.py` compares
-generic and forced-compatibility scheduling for a static DAG. Its fixture
-corpus covers fresh completion, partial checkpoints, versioned rehydration,
-in-flight claim replay, and injected failure. It intentionally does not claim
-durable persistence of the generic scheduler's private claim set, nor does it
-cover loop or workflow-call ownership migration.
+generic and forced-compatibility scheduling for static DAGs and a constructed
+mixed/nested `If` graph. Its fixture corpus covers fresh completion, true/false
+branch selection, nested branch isolation, partial checkpoints, versioned
+rehydration, in-flight claim replay, activation-token persistence, and injected
+failure. The `If` comparison includes strict source-level results, executed
+history, errors, terminal state, and normalized indegrees; compatibility skip
+propagation must not leave stale downstream indegrees. It intentionally does
+not claim durable persistence of the generic scheduler's private claim set, nor
+does it cover loop or workflow-call ownership migration.
Workflow-call note:
diff --git a/invokeai/app/services/shared/graph.py b/invokeai/app/services/shared/graph.py
index 459728d733..793e57e196 100644
--- a/invokeai/app/services/shared/graph.py
+++ b/invokeai/app/services/shared/graph.py
@@ -452,7 +452,7 @@ class _IfBranchScheduler:
self._state._set_prepared_exec_state(exec_node_id, "skipped")
self._state._tx_add_set(self._state.executed, exec_node_id)
scheduler = self._state._execution_scheduler
- if isinstance(scheduler, _GenericGraphSchedulerAdapter):
+ if scheduler is not None:
scheduler.mark_skipped(exec_node_id)
registry = self._state._prepared_registry()
@@ -2073,6 +2073,15 @@ class _ExecutionScheduler:
continue
self._state._tx_discard_set(self._state._ready_node_ids, exec_node_id)
+ def mark_skipped(self, exec_node_id: str) -> None:
+ """Satisfy downstream indegrees without resolving inputs from a skipped node."""
+ self._validate_exec_node_ready_state(exec_node_id)
+ for edge in self._state.execution_graph._get_output_edges(exec_node_id):
+ child = edge.destination.node_id
+ self._decrement_child_indegree(child, exec_node_id)
+ if self._state.indegree[child] == 0:
+ self.enqueue_if_ready(child)
+
def enqueue_if_ready(self, exec_node_id: str) -> None:
"""Push exec_node_id to its class queue if unmet inputs == 0."""
self._validate_exec_node_ready_state(exec_node_id)