From 6a74048af89b5066a9538f2167b3336e95317ca9 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sun, 18 Feb 2024 11:25:00 +1100 Subject: [PATCH] feat(nodes): promote `is_canceled` to public node API --- invokeai/app/services/shared/invocation_context.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invokeai/app/services/shared/invocation_context.py b/invokeai/app/services/shared/invocation_context.py index 4606bd9e03..317cbdbb23 100644 --- a/invokeai/app/services/shared/invocation_context.py +++ b/invokeai/app/services/shared/invocation_context.py @@ -437,11 +437,12 @@ class InvocationContext: """Provides utility methods.""" self.boards = boards """Provides methods to interact with boards.""" + self.is_canceled = is_canceled + """Checks if the current invocation has been canceled.""" self._data = context_data """Provides data about the current queue item and invocation. This is an internal API and may change without warning.""" self._services = services """Provides access to the full application services. This is an internal API and may change without warning.""" - self._is_canceled = is_canceled def build_invocation_context( @@ -457,6 +458,7 @@ def build_invocation_context( """ def is_canceled() -> bool: + """Checks if the current invocation has been canceled.""" return cancel_event.is_set() logger = LoggerInterface(services=services, context_data=context_data)