The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Add timestamp to execution messages (#4076)
Chenlei Hu5b69cfe7c343
diff --git a/execution.py b/execution.pyindex 8b3d116c6..0a2e62e7e 100644--- a/execution.py+++ b/execution.py@@ -3,6 +3,7 @@ import copyimport loggingimport threadingimport heapq+import timeimport tracebackimport inspectfrom typing import List, Literal, NamedTuple, Optional@@ -283,7 +284,11 @@ class PromptExecutor:self.success = Trueself.old_prompt = {}- def add_message(self, event, data, broadcast: bool):+ def add_message(self, event, data: dict, broadcast: bool):+ data = {+ **data,+ "timestamp": int(time.time() * 1000),+ }self.status_messages.append((event, data))if self.server.client_id is not None or broadcast:self.server.send_sync(event, data, self.server.client_id)@@ -394,6 +399,9 @@ class PromptExecutor:if self.success is not True:self.handle_execution_error(prompt_id, prompt, current_outputs, executed, error, ex)break+ else:+ # Only execute when the while-loop ends without break+ self.add_message("execution_success", { "prompt_id": prompt_id }, broadcast=False)for x in executed:self.old_prompt[x] = copy.deepcopy(prompt[x])