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
93d84e3b
Commit
93d84e3b
authored
Feb 13, 2023
by
comfyanonymous
Browse files
Lower timeout and fix for colab.
parent
68a1ac77
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
webshit/index.html
webshit/index.html
+13
-1
No files found.
webshit/index.html
View file @
93d84e3b
...
@@ -480,11 +480,21 @@ document.addEventListener('drop', (event) => {
...
@@ -480,11 +480,21 @@ document.addEventListener('drop', (event) => {
prompt_file_load
(
file
);
prompt_file_load
(
file
);
});
});
(()
=>
{
(()
=>
{
function
updateStatus
(
data
)
{
function
updateStatus
(
data
)
{
document
.
getElementById
(
"
queuesize
"
).
innerHTML
=
"
Queue size:
"
+
(
data
?
data
.
exec_info
.
queue_remaining
:
"
ERR
"
);
document
.
getElementById
(
"
queuesize
"
).
innerHTML
=
"
Queue size:
"
+
(
data
?
data
.
exec_info
.
queue_remaining
:
"
ERR
"
);
}
}
//fix for colab and other things that don't support websockets.
function
manually_fetch_queue
()
{
fetch
(
'
/prompt
'
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
updateStatus
(
data
.
exec_info
.
queue_remaining
);
}).
catch
((
response
)
=>
{
updateStatus
(
null
)});
}
let
ws
;
let
ws
;
function
createSocket
(
isReconnect
)
{
function
createSocket
(
isReconnect
)
{
if
(
ws
)
return
;
if
(
ws
)
return
;
...
@@ -501,14 +511,16 @@ document.addEventListener('drop', (event) => {
...
@@ -501,14 +511,16 @@ document.addEventListener('drop', (event) => {
ws
.
addEventListener
(
"
error
"
,
()
=>
{
ws
.
addEventListener
(
"
error
"
,
()
=>
{
if
(
ws
)
ws
.
close
();
if
(
ws
)
ws
.
close
();
manually_fetch_queue
();
});
});
ws
.
addEventListener
(
"
close
"
,
()
=>
{
ws
.
addEventListener
(
"
close
"
,
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
ws
=
null
;
ws
=
null
;
createSocket
(
true
);
createSocket
(
true
);
},
10
00
);
},
3
00
);
if
(
opened
)
{
if
(
opened
)
{
updateStatus
(
null
);
showModal
(
"
Reconnecting...
"
);
showModal
(
"
Reconnecting...
"
);
}
}
});
});
...
...
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