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
66831eb6
Commit
66831eb6
authored
Jan 01, 2024
by
comfyanonymous
Browse files
Add node id and prompt id to websocket progress packet.
parent
d1f3637a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
main.py
main.py
+5
-1
No files found.
main.py
View file @
66831eb6
...
@@ -106,6 +106,8 @@ def prompt_worker(q, server):
...
@@ -106,6 +106,8 @@ def prompt_worker(q, server):
item
,
item_id
=
queue_item
item
,
item_id
=
queue_item
execution_start_time
=
time
.
perf_counter
()
execution_start_time
=
time
.
perf_counter
()
prompt_id
=
item
[
1
]
prompt_id
=
item
[
1
]
server
.
last_prompt_id
=
prompt_id
e
.
execute
(
item
[
2
],
prompt_id
,
item
[
3
],
item
[
4
])
e
.
execute
(
item
[
2
],
prompt_id
,
item
[
3
],
item
[
4
])
need_gc
=
True
need_gc
=
True
q
.
task_done
(
item_id
,
e
.
outputs_ui
)
q
.
task_done
(
item_id
,
e
.
outputs_ui
)
...
@@ -131,7 +133,9 @@ async def run(server, address='', port=8188, verbose=True, call_on_start=None):
...
@@ -131,7 +133,9 @@ 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
()
comfy
.
model_management
.
throw_exception_if_processing_interrupted
()
server
.
send_sync
(
"progress"
,
{
"value"
:
value
,
"max"
:
total
},
server
.
client_id
)
progress
=
{
"value"
:
value
,
"max"
:
total
,
"prompt_id"
:
server
.
last_prompt_id
,
"node"
:
server
.
last_node_id
}
server
.
send_sync
(
"progress"
,
progress
,
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
)
comfy
.
utils
.
set_progress_bar_global_hook
(
hook
)
comfy
.
utils
.
set_progress_bar_global_hook
(
hook
)
...
...
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