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
af91df85
Commit
af91df85
authored
Jun 12, 2023
by
comfyanonymous
Browse files
Add a /history/{prompt_id} endpoint.
parent
67833c83
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
execution.py
execution.py
+7
-2
server.py
server.py
+5
-0
No files found.
execution.py
View file @
af91df85
...
@@ -728,9 +728,14 @@ class PromptQueue:
...
@@ -728,9 +728,14 @@ class PromptQueue:
return
True
return
True
return
False
return
False
def
get_history
(
self
):
def
get_history
(
self
,
prompt_id
=
None
):
with
self
.
mutex
:
with
self
.
mutex
:
return
copy
.
deepcopy
(
self
.
history
)
if
prompt_id
is
None
:
return
copy
.
deepcopy
(
self
.
history
)
elif
prompt_id
in
self
.
history
:
return
{
prompt_id
:
copy
.
deepcopy
(
self
.
history
[
prompt_id
])}
else
:
return
{}
def
wipe_history
(
self
):
def
wipe_history
(
self
):
with
self
.
mutex
:
with
self
.
mutex
:
...
...
server.py
View file @
af91df85
...
@@ -372,6 +372,11 @@ class PromptServer():
...
@@ -372,6 +372,11 @@ class PromptServer():
async
def
get_history
(
request
):
async
def
get_history
(
request
):
return
web
.
json_response
(
self
.
prompt_queue
.
get_history
())
return
web
.
json_response
(
self
.
prompt_queue
.
get_history
())
@
routes
.
get
(
"/history/{prompt_id}"
)
async
def
get_history
(
request
):
prompt_id
=
request
.
match_info
.
get
(
"prompt_id"
,
None
)
return
web
.
json_response
(
self
.
prompt_queue
.
get_history
(
prompt_id
=
prompt_id
))
@
routes
.
get
(
"/queue"
)
@
routes
.
get
(
"/queue"
)
async
def
get_queue
(
request
):
async
def
get_queue
(
request
):
queue_info
=
{}
queue_info
=
{}
...
...
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