Rename status notes to status messages.
I think message describes them better.
This commit is contained in:
parent
bcc0bde2af
commit
56d9496b18
18
execution.py
18
execution.py
|
@ -276,12 +276,12 @@ class PromptExecutor:
|
||||||
self.outputs = {}
|
self.outputs = {}
|
||||||
self.object_storage = {}
|
self.object_storage = {}
|
||||||
self.outputs_ui = {}
|
self.outputs_ui = {}
|
||||||
self.status_notes = []
|
self.status_messages = []
|
||||||
self.success = True
|
self.success = True
|
||||||
self.old_prompt = {}
|
self.old_prompt = {}
|
||||||
|
|
||||||
def add_note(self, event, data, broadcast: bool):
|
def add_message(self, event, data, broadcast: bool):
|
||||||
self.status_notes.append((event, data))
|
self.status_messages.append((event, data))
|
||||||
if self.server.client_id is not None or broadcast:
|
if self.server.client_id is not None or broadcast:
|
||||||
self.server.send_sync(event, data, self.server.client_id)
|
self.server.send_sync(event, data, self.server.client_id)
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ class PromptExecutor:
|
||||||
"node_type": class_type,
|
"node_type": class_type,
|
||||||
"executed": list(executed),
|
"executed": list(executed),
|
||||||
}
|
}
|
||||||
self.add_note("execution_interrupted", mes, broadcast=True)
|
self.add_message("execution_interrupted", mes, broadcast=True)
|
||||||
else:
|
else:
|
||||||
mes = {
|
mes = {
|
||||||
"prompt_id": prompt_id,
|
"prompt_id": prompt_id,
|
||||||
|
@ -312,7 +312,7 @@ class PromptExecutor:
|
||||||
"current_inputs": error["current_inputs"],
|
"current_inputs": error["current_inputs"],
|
||||||
"current_outputs": error["current_outputs"],
|
"current_outputs": error["current_outputs"],
|
||||||
}
|
}
|
||||||
self.add_note("execution_error", mes, broadcast=False)
|
self.add_message("execution_error", mes, broadcast=False)
|
||||||
|
|
||||||
# Next, remove the subsequent outputs since they will not be executed
|
# Next, remove the subsequent outputs since they will not be executed
|
||||||
to_delete = []
|
to_delete = []
|
||||||
|
@ -334,8 +334,8 @@ class PromptExecutor:
|
||||||
else:
|
else:
|
||||||
self.server.client_id = None
|
self.server.client_id = None
|
||||||
|
|
||||||
self.status_notes = []
|
self.status_messages = []
|
||||||
self.add_note("execution_start", { "prompt_id": prompt_id}, broadcast=False)
|
self.add_message("execution_start", { "prompt_id": prompt_id}, broadcast=False)
|
||||||
|
|
||||||
with torch.inference_mode():
|
with torch.inference_mode():
|
||||||
#delete cached outputs if nodes don't exist for them
|
#delete cached outputs if nodes don't exist for them
|
||||||
|
@ -368,7 +368,7 @@ class PromptExecutor:
|
||||||
del d
|
del d
|
||||||
|
|
||||||
comfy.model_management.cleanup_models()
|
comfy.model_management.cleanup_models()
|
||||||
self.add_note("execution_cached",
|
self.add_message("execution_cached",
|
||||||
{ "nodes": list(current_outputs) , "prompt_id": prompt_id},
|
{ "nodes": list(current_outputs) , "prompt_id": prompt_id},
|
||||||
broadcast=False)
|
broadcast=False)
|
||||||
executed = set()
|
executed = set()
|
||||||
|
@ -742,7 +742,7 @@ class PromptQueue:
|
||||||
class ExecutionStatus(NamedTuple):
|
class ExecutionStatus(NamedTuple):
|
||||||
status_str: Literal['success', 'error']
|
status_str: Literal['success', 'error']
|
||||||
completed: bool
|
completed: bool
|
||||||
notes: List[str]
|
messages: List[str]
|
||||||
|
|
||||||
def task_done(self, item_id, outputs,
|
def task_done(self, item_id, outputs,
|
||||||
status: Optional['PromptQueue.ExecutionStatus']):
|
status: Optional['PromptQueue.ExecutionStatus']):
|
||||||
|
|
2
main.py
2
main.py
|
@ -115,7 +115,7 @@ def prompt_worker(q, server):
|
||||||
status=execution.PromptQueue.ExecutionStatus(
|
status=execution.PromptQueue.ExecutionStatus(
|
||||||
status_str='success' if e.success else 'error',
|
status_str='success' if e.success else 'error',
|
||||||
completed=e.success,
|
completed=e.success,
|
||||||
notes=e.status_notes))
|
messages=e.status_messages))
|
||||||
if server.client_id is not None:
|
if server.client_id is not None:
|
||||||
server.send_sync("executing", { "node": None, "prompt_id": prompt_id }, server.client_id)
|
server.send_sync("executing", { "node": None, "prompt_id": prompt_id }, server.client_id)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue