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
223177e1
Commit
223177e1
authored
Mar 26, 2023
by
comfyanonymous
Browse files
Merge branch 'custom-node-socket' of
https://github.com/pythongosssss/ComfyUI
parents
8a35c12e
a49b5659
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
server.py
server.py
+2
-0
web/scripts/api.js
web/scripts/api.js
+12
-1
No files found.
server.py
View file @
223177e1
...
...
@@ -29,6 +29,8 @@ async def cache_control(request: web.Request, handler):
class
PromptServer
():
def
__init__
(
self
,
loop
):
PromptServer
.
instance
=
self
mimetypes
.
init
();
mimetypes
.
types_map
[
'.js'
]
=
'application/javascript; charset=utf-8'
self
.
prompt_queue
=
None
...
...
web/scripts/api.js
View file @
223177e1
class
ComfyApi
extends
EventTarget
{
#
registered
=
new
Set
();
constructor
()
{
super
();
}
addEventListener
(
type
,
callback
,
options
)
{
super
.
addEventListener
(
type
,
callback
,
options
);
this
.
#
registered
.
add
(
type
);
}
/**
* Poll status for colab and other things that don't support websockets.
*/
...
...
@@ -82,8 +89,12 @@ class ComfyApi extends EventTarget {
this
.
dispatchEvent
(
new
CustomEvent
(
"
executed
"
,
{
detail
:
msg
.
data
}));
break
;
default
:
if
(
this
.
#
registered
.
has
(
msg
.
type
))
{
this
.
dispatchEvent
(
new
CustomEvent
(
msg
.
type
,
{
detail
:
msg
.
data
}));
}
else
{
throw
new
Error
(
"
Unknown message type
"
);
}
}
}
catch
(
error
)
{
console
.
warn
(
"
Unhandled message:
"
,
event
.
data
);
}
...
...
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