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
326577d0
Commit
326577d0
authored
Sep 07, 2023
by
comfyanonymous
Browse files
Allow cancelling of everything with a progress bar.
parent
9261587d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
2 deletions
+1
-2
comfy/samplers.py
comfy/samplers.py
+0
-2
main.py
main.py
+1
-0
No files found.
comfy/samplers.py
View file @
326577d0
...
@@ -263,8 +263,6 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con
...
@@ -263,8 +263,6 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con
output
=
model_function
(
input_x
,
timestep_
,
**
c
).
chunk
(
batch_chunks
)
output
=
model_function
(
input_x
,
timestep_
,
**
c
).
chunk
(
batch_chunks
)
del
input_x
del
input_x
model_management
.
throw_exception_if_processing_interrupted
()
for
o
in
range
(
batch_chunks
):
for
o
in
range
(
batch_chunks
):
if
cond_or_uncond
[
o
]
==
COND
:
if
cond_or_uncond
[
o
]
==
COND
:
out_cond
[:,:,
area
[
o
][
2
]:
area
[
o
][
0
]
+
area
[
o
][
2
],
area
[
o
][
3
]:
area
[
o
][
1
]
+
area
[
o
][
3
]]
+=
output
[
o
]
*
mult
[
o
]
out_cond
[:,:,
area
[
o
][
2
]:
area
[
o
][
0
]
+
area
[
o
][
2
],
area
[
o
][
3
]:
area
[
o
][
1
]
+
area
[
o
][
3
]]
+=
output
[
o
]
*
mult
[
o
]
...
...
main.py
View file @
326577d0
...
@@ -104,6 +104,7 @@ async def run(server, address='', port=8188, verbose=True, call_on_start=None):
...
@@ -104,6 +104,7 @@ async def run(server, address='', port=8188, verbose=True, call_on_start=None):
def
hijack_progress
(
server
):
def
hijack_progress
(
server
):
def
hook
(
value
,
total
,
preview_image
):
def
hook
(
value
,
total
,
preview_image
):
comfy
.
model_management
.
throw_exception_if_processing_interrupted
()
server
.
send_sync
(
"progress"
,
{
"value"
:
value
,
"max"
:
total
},
server
.
client_id
)
server
.
send_sync
(
"progress"
,
{
"value"
:
value
,
"max"
:
total
},
server
.
client_id
)
if
preview_image
is
not
None
:
if
preview_image
is
not
None
:
server
.
send_sync
(
BinaryEventTypes
.
UNENCODED_PREVIEW_IMAGE
,
preview_image
,
server
.
client_id
)
server
.
send_sync
(
BinaryEventTypes
.
UNENCODED_PREVIEW_IMAGE
,
preview_image
,
server
.
client_id
)
...
...
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