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
6be7c642
Commit
6be7c642
authored
Apr 02, 2023
by
comfyanonymous
Browse files
Merge branch 'custom_routes' of
https://github.com/pythongosssss/ComfyUI
parents
66f1f576
38833ceb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
main.py
main.py
+3
-1
nodes.py
nodes.py
+3
-3
server.py
server.py
+4
-2
No files found.
main.py
View file @
6be7c642
...
...
@@ -45,6 +45,7 @@ if __name__ == "__main__":
except
:
pass
from
nodes
import
init_custom_nodes
import
execution
import
server
import
folder_paths
...
...
@@ -103,6 +104,8 @@ if __name__ == "__main__":
server
=
server
.
PromptServer
(
loop
)
q
=
execution
.
PromptQueue
(
server
)
init_custom_nodes
()
server
.
add_routes
()
hijack_progress
(
server
)
threading
.
Thread
(
target
=
prompt_worker
,
daemon
=
True
,
args
=
(
q
,
server
,)).
start
()
...
...
@@ -118,7 +121,6 @@ if __name__ == "__main__":
except
:
address
=
'127.0.0.1'
dont_print
=
False
if
'--dont-print-server'
in
sys
.
argv
:
dont_print
=
True
...
...
nodes.py
View file @
6be7c642
...
...
@@ -1110,6 +1110,6 @@ def load_custom_nodes():
if
os
.
path
.
isfile
(
module_path
)
and
os
.
path
.
splitext
(
module_path
)[
1
]
!=
".py"
:
continue
load_custom_node
(
module_path
)
load_custom_nodes
()
load_custom_node
(
os
.
path
.
join
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
"comfy_extras"
),
"nodes_upscale_model.py"
))
\ No newline at end of file
def
init_custom_nodes
():
load_custom_nodes
()
load_custom_node
(
os
.
path
.
join
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
"comfy_extras"
),
"nodes_upscale_model.py"
))
\ No newline at end of file
server.py
View file @
6be7c642
...
...
@@ -42,6 +42,7 @@ class PromptServer():
self
.
web_root
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
"web"
)
routes
=
web
.
RouteTableDef
()
self
.
routes
=
routes
self
.
last_node_id
=
None
self
.
client_id
=
None
...
...
@@ -239,8 +240,9 @@ class PromptServer():
self
.
prompt_queue
.
delete_history_item
(
id_to_delete
)
return
web
.
Response
(
status
=
200
)
self
.
app
.
add_routes
(
routes
)
def
add_routes
(
self
):
self
.
app
.
add_routes
(
self
.
routes
)
self
.
app
.
add_routes
([
web
.
static
(
'/'
,
self
.
web_root
),
])
...
...
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