Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
c8ce599a
Commit
c8ce599a
authored
Mar 02, 2023
by
comfyanonymous
Browse files
Add a button to interrupt processing to the ui.
parent
69cc75fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
execution.py
execution.py
+2
-0
nodes.py
nodes.py
+2
-2
webshit/index.html
webshit/index.html
+6
-0
No files found.
execution.py
View file @
c8ce599a
...
...
@@ -135,6 +135,8 @@ class PromptExecutor:
self
.
server
=
server
def
execute
(
self
,
prompt
,
extra_data
=
{}):
nodes
.
interrupt_processing
(
False
)
if
"client_id"
in
extra_data
:
self
.
server
.
client_id
=
extra_data
[
"client_id"
]
else
:
...
...
nodes.py
View file @
c8ce599a
...
...
@@ -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
:
@
classmethod
...
...
webshit/index.html
View file @
c8ce599a
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment