mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Revert "feat(nodes): add warning socket event"
This reverts commit cefdd9d634e515239bd85666c872a0d64bb9d772.
This commit is contained in:
parent
09f396ce84
commit
b51e9a6bdb
@ -49,14 +49,8 @@ class DynamicPromptInvocation(BaseInvocation):
|
|||||||
combinatorial: bool = Field(
|
combinatorial: bool = Field(
|
||||||
default=False, description="Whether to use the combinatorial generator"
|
default=False, description="Whether to use the combinatorial generator"
|
||||||
)
|
)
|
||||||
# wildcard_path: Optional[str] = Field(default=None, description="Wildcard path")
|
|
||||||
|
|
||||||
def invoke(self, context: InvocationContext) -> PromptListOutput:
|
def invoke(self, context: InvocationContext) -> PromptListOutput:
|
||||||
# if self.wildcard_path is not None:
|
|
||||||
# try:
|
|
||||||
# os.stat(self.wildcard_path)
|
|
||||||
# except FileNotFoundError:
|
|
||||||
# context.services.logger.warn(f"Invalid wildcard path ({self.wildcard_path}), ignoring")
|
|
||||||
try:
|
try:
|
||||||
if self.combinatorial:
|
if self.combinatorial:
|
||||||
generator = CombinatorialPromptGenerator()
|
generator = CombinatorialPromptGenerator()
|
||||||
@ -67,16 +61,6 @@ class DynamicPromptInvocation(BaseInvocation):
|
|||||||
except ParseException as e:
|
except ParseException as e:
|
||||||
warning = f"Invalid dynamic prompt: {e}"
|
warning = f"Invalid dynamic prompt: {e}"
|
||||||
context.services.logger.warn(warning)
|
context.services.logger.warn(warning)
|
||||||
graph_execution_state = context.services.graph_execution_manager.get(
|
|
||||||
context.graph_execution_state_id
|
|
||||||
)
|
|
||||||
source_node_id = graph_execution_state.prepared_source_mapping[self.id]
|
|
||||||
context.services.events.emit_invocation_warning(
|
|
||||||
warning=warning,
|
|
||||||
graph_execution_state_id=context.graph_execution_state_id,
|
|
||||||
node=self.dict(),
|
|
||||||
source_node_id=source_node_id,
|
|
||||||
)
|
|
||||||
return PromptListOutput(prompts=[self.prompt], count=1)
|
return PromptListOutput(prompts=[self.prompt], count=1)
|
||||||
|
|
||||||
return PromptListOutput(prompts=prompts, count=len(prompts))
|
return PromptListOutput(prompts=prompts, count=len(prompts))
|
||||||
|
@ -69,7 +69,7 @@ class EventServiceBase:
|
|||||||
source_node_id: str,
|
source_node_id: str,
|
||||||
error: str,
|
error: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Emitted when an invocation has encountered a fatal error"""
|
"""Emitted when an invocation has completed"""
|
||||||
self.__emit_session_event(
|
self.__emit_session_event(
|
||||||
event_name="invocation_error",
|
event_name="invocation_error",
|
||||||
payload=dict(
|
payload=dict(
|
||||||
@ -80,24 +80,6 @@ class EventServiceBase:
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
def emit_invocation_warning(
|
|
||||||
self,
|
|
||||||
graph_execution_state_id: str,
|
|
||||||
node: dict,
|
|
||||||
source_node_id: str,
|
|
||||||
warning: str,
|
|
||||||
) -> None:
|
|
||||||
"""Emitted when an invocation has encountered a state that may be problematic"""
|
|
||||||
self.__emit_session_event(
|
|
||||||
event_name="invocation_warning",
|
|
||||||
payload=dict(
|
|
||||||
graph_execution_state_id=graph_execution_state_id,
|
|
||||||
node=node,
|
|
||||||
source_node_id=source_node_id,
|
|
||||||
warning=warning,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
def emit_invocation_started(
|
def emit_invocation_started(
|
||||||
self, graph_execution_state_id: str, node: dict, source_node_id: str
|
self, graph_execution_state_id: str, node: dict, source_node_id: str
|
||||||
) -> None:
|
) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user