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.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
perf(execution): stop re-scanning the graph on every node completion
Alexander Eichhorn07a542ba6bd2
diff --git a/invokeai/app/invocations/baseinvocation.py b/invokeai/app/invocations/baseinvocation.pyindex fe43716eed..6b10b4181a 100644--- a/invokeai/app/invocations/baseinvocation.py+++ b/invokeai/app/invocations/baseinvocation.py@@ -205,8 +205,11 @@ class BaseInvocation(ABC, BaseModel):return cls.model_fields["type"].default@classmethod+ @lru_cache(maxsize=None)def get_output_annotation(cls) -> Type[BaseInvocationOutput]:"""Gets the invocation's output annotation (i.e. the return annotation of its `invoke()` method)."""+ # Cached per class: the execution engine asks for this on every node completion, and+ # `inspect.signature` is far too slow for that.return signature(cls.invoke).return_annotation@staticmethoddiff --git a/invokeai/app/services/shared/graph_if_dependencies.py b/invokeai/app/services/shared/graph_if_dependencies.pyindex cec1c6d7e8..ba5746c7df 100644--- a/invokeai/app/services/shared/graph_if_dependencies.py+++ b/invokeai/app/services/shared/graph_if_dependencies.py@@ -267,7 +267,7 @@ def _get_source_activation_dependencies(if key in state._if_activation_dependencies_by_source:return state._if_activation_dependencies_by_source[key]- if not _can_use_fresh_flat_if_activation(state):+ if not state._can_use_fresh_flat_if_activation():return state._if_activation_controller().get_source_dependencies(source_node_id, iteration_path)dependencies = tuple(