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 a button to interrupt processing to the ui.
comfyanonymousc8ce599a8f8c
diff --git a/execution.py b/execution.pyindex b0f4f9527..43cab2074 100644--- a/execution.py+++ b/execution.py@@ -135,6 +135,8 @@ class PromptExecutor:self.server = serverdef execute(self, prompt, extra_data={}):+ nodes.interrupt_processing(False)+if "client_id" in extra_data:self.server.client_id = extra_data["client_id"]else:diff --git a/nodes.py b/nodes.pyindex fe24a6cd5..02cb7e8ec 100644--- a/nodes.py+++ b/nodes.py@@ -45,8 +45,8 @@ def filter_files_extensions(files, extensions):def before_node_execution():model_management.throw_exception_if_processing_interrupted()-def interrupt_processing():- model_management.interrupt_current_processing()+def interrupt_processing(value=True):+ model_management.interrupt_current_processing(value)class CLIPTextEncode:@classmethoddiff --git a/webshit/index.html b/webshit/index.htmlindex 410fb744d..a4f3667b9 100644--- a/webshit/index.html+++ b/webshit/index.html@@ -796,6 +796,11 @@ function setRunningNode(id) {(() => {function updateStatus(data) {document.getElementById("queuesize").innerHTML = "Queue size: " + (data ? data.exec_info.queue_remaining : "ERR");+ if (data && data.exec_info.queue_remaining) {+ document.getElementById("cancelcurrentjobbutton").hidden = false;+ } else {+ document.getElementById("cancelcurrentjobbutton").hidden = true;+ }}//fix for colab and other things that don't support websockets.@@ -1083,6 +1088,7 @@ function clearItems(type) {<button style="font-size: 10px;">Load</button><br></div>+ <button style="font-size: 10px;" hidden onclick="clearItems('interrupt')" id="cancelcurrentjobbutton">Cancel Current</button><br><span style="left: 0%;padding: 3px;display:inline-block;">Queued:</span><div id="queuecontents" style="overflow-y: scroll;height: 100px;background-color: #d0d0d0;padding: 5px;"><a>1</a>