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
9f391ab6
Unverified
Commit
9f391ab6
authored
Feb 23, 2023
by
pythongosssss
Committed by
GitHub
Feb 23, 2023
Browse files
changed to store history by uniqueid
fixed removing history items
parent
5c5725da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
main.py
main.py
+3
-2
webshit/index.html
webshit/index.html
+6
-6
No files found.
main.py
View file @
9f391ab6
...
@@ -335,10 +335,11 @@ class PromptQueue:
...
@@ -335,10 +335,11 @@ class PromptQueue:
def
task_done
(
self
,
item_id
,
outputs
):
def
task_done
(
self
,
item_id
,
outputs
):
with
self
.
mutex
:
with
self
.
mutex
:
self
.
history
[
item_id
]
=
{
"prompt"
:
self
.
currently_running
.
pop
(
item_id
),
"outputs"
:
{}
}
prompt
=
self
.
currently_running
.
pop
(
item_id
)
self
.
history
[
prompt
[
1
]]
=
{
"prompt"
:
prompt
,
"outputs"
:
{}
}
for
o
in
outputs
:
for
o
in
outputs
:
if
"ui"
in
outputs
[
o
]:
if
"ui"
in
outputs
[
o
]:
self
.
history
[
item_id
][
"outputs"
][
o
]
=
outputs
[
o
][
"ui"
]
self
.
history
[
prompt
[
1
]
][
"outputs"
][
o
]
=
outputs
[
o
][
"ui"
]
self
.
server
.
queue_updated
()
self
.
server
.
queue_updated
()
def
get_current_queue
(
self
):
def
get_current_queue
(
self
):
...
...
webshit/index.html
View file @
9f391ab6
...
@@ -790,7 +790,7 @@ function loadItems(type) {
...
@@ -790,7 +790,7 @@ function loadItems(type) {
button
.
style
.
fontSize
=
"
10px
"
;
button
.
style
.
fontSize
=
"
10px
"
;
button
.
delete_id
=
id
;
button
.
delete_id
=
id
;
button
.
onclick
=
function
(
event
)
{
button
.
onclick
=
function
(
event
)
{
deleteQueueElement
(
type
,
event
.
target
.
delete_id
,
loadItems
);
deleteQueueElement
(
type
,
event
.
target
.
delete_id
,
()
=>
loadItems
(
type
)
);
};
};
append_to_element
.
appendChild
(
button
);
append_to_element
.
appendChild
(
button
);
}
}
...
@@ -807,11 +807,11 @@ function loadItems(type) {
...
@@ -807,11 +807,11 @@ function loadItems(type) {
if
(
type
===
"
queue
"
)
{
if
(
type
===
"
queue
"
)
{
items
=
data
.
queue_pending
;
items
=
data
.
queue_pending
;
}
else
{
}
else
{
items
=
Object
.
values
(
data
)
.
map
(
d
=>
d
.
prompt
)
;
items
=
Object
.
values
(
data
);
}
}
items
.
sort
((
a
,
b
)
=>
a
[
0
]
-
b
[
0
]);
items
.
sort
((
a
,
b
)
=>
a
[
0
]
-
b
[
0
]);
for
(
let
i
in
items
)
{
for
(
let
i
of
items
)
{
append_to_list
(
items
[
i
],
queuecontents
,
true
,
type
===
"
queue
"
?
null
:
data
[
i
]
.
outputs
);
append_to_list
(
type
===
"
queue
"
?
i
:
i
.
prompt
,
queuecontents
,
true
,
i
.
outputs
);
}
}
}).
catch
((
response
)
=>
{
console
.
log
(
response
)});
}).
catch
((
response
)
=>
{
console
.
log
(
response
)});
}
}
...
@@ -891,7 +891,7 @@ function clearItems(type) {
...
@@ -891,7 +891,7 @@ function clearItems(type) {
<br>
<br>
</div>
</div>
<span
style=
"padding: 5px;display:inline-block;"
>
<span
style=
"padding: 5px;display:inline-block;"
>
<button
style=
"font-size: 12px;"
onclick=
"clear
Q
ueue
(
)"
>
Clear Queue
</button>
<button
style=
"font-size: 12px;"
onclick=
"clear
Items('q
ueue
'
)"
>
Clear Queue
</button>
<button
style=
"font-size: 12px;"
onclick=
"loadQueue()"
>
Refresh
</button>
<button
style=
"font-size: 12px;"
onclick=
"loadQueue()"
>
Refresh
</button>
</span>
</span>
</div>
</div>
...
@@ -901,7 +901,7 @@ function clearItems(type) {
...
@@ -901,7 +901,7 @@ function clearItems(type) {
<div
id=
"historycontents"
style=
"overflow-y: scroll;height: 100px;background-color: #d0d0d0;padding: 5px;"
>
<div
id=
"historycontents"
style=
"overflow-y: scroll;height: 100px;background-color: #d0d0d0;padding: 5px;"
>
</div>
</div>
<span
style=
"padding: 5px;display:inline-block;"
>
<span
style=
"padding: 5px;display:inline-block;"
>
<button
style=
"font-size: 12px;"
onclick=
"clear
H
istory
(
)"
>
Clear History
</button>
<button
style=
"font-size: 12px;"
onclick=
"clear
Items('h
istory
'
)"
>
Clear History
</button>
<button
style=
"font-size: 12px;"
onclick=
"loadHistory()"
>
Refresh
</button>
<button
style=
"font-size: 12px;"
onclick=
"loadHistory()"
>
Refresh
</button>
</span>
</span>
</div>
</div>
...
...
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