Open martjay opened 9 months ago
Move all custom nodes to a different directory and check if there are no issues with the default ComfyUI. Then gradually reintroduce them one by one to see if a specific custom node is causing the problem.
@martjay change the file server.py
under the ComfyUI folder:
add_routes
in class PromptServer
:original:
def add_routes(self):
self.user_manager.add_routes(self.routes)
self.app.add_routes(self.routes)
for name, dir in nodes.EXTENSION_WEB_DIRS.items():
self.app.add_routes([
web.static('/extensions/' + urllib.parse.quote(name), dir),
])
self.app.add_routes([
web.static('/', self.web_root),
])
modify to:
def add_routes(self):
routes_names = []
fin_routes = []
for r in self.routes:
if r.method+r.path in routes_names:
print(f"[Duplicate route(s)]: {r.method} {r.path}")
else:
fin_routes.append(r)
routes_names.append(r.method+r.path)
final_routes = RouteTableDef()
final_routes._items = fin_routes
self.user_manager.add_routes(final_routes)
# self.user_manager.add_routes(self.routes)
self.app.add_routes(final_routes)
# self.app.add_routes(self.routes)
for name, dir in nodes.EXTENSION_WEB_DIRS.items():
self.app.add_routes([
web.static('/extensions/' + urllib.parse.quote(name), dir),
])
self.app.add_routes([
web.static('/', self.web_root),
])
from aiohttp.web_routedef import RouteTableDef
in the server.py
Then you can see which guy wrote bug(s).
@martjay change the file
server.py
under the ComfyUI folder:1. Find function
add_routes
in classPromptServer
:
- original:
def add_routes(self): self.user_manager.add_routes(self.routes) self.app.add_routes(self.routes) for name, dir in nodes.EXTENSION_WEB_DIRS.items(): self.app.add_routes([ web.static('/extensions/' + urllib.parse.quote(name), dir), ]) self.app.add_routes([ web.static('/', self.web_root), ])
- modify to:
def add_routes(self): routes_names = [] fin_routes = [] for r in self.routes: if r.method+r.path in routes_names: print(f"[Duplicate route(s)]: {r.method} {r.path}") else: fin_routes.append(r) routes_names.append(r.method+r.path) final_routes = RouteTableDef() final_routes._items = fin_routes self.user_manager.add_routes(final_routes) # self.user_manager.add_routes(self.routes) self.app.add_routes(final_routes) # self.app.add_routes(self.routes) for name, dir in nodes.EXTENSION_WEB_DIRS.items(): self.app.add_routes([ web.static('/extensions/' + urllib.parse.quote(name), dir), ]) self.app.add_routes([ web.static('/', self.web_root), ])
2. Add
from aiohttp.web_routedef import RouteTableDef
in theserver.py
Then you can see which guy wrote bug(s).
Edit: Scratch, it worked, or bypassed/fixed, i just forgot to make def
to start at the first vertical line :P
Doesn't show who wrote the bug though, i don't think.
Old:
That didn't work for me :S
@martjay change the file
server.py
under the ComfyUI folder:1. Find function
add_routes
in classPromptServer
:
- original:
def add_routes(self): self.user_manager.add_routes(self.routes) self.app.add_routes(self.routes) for name, dir in nodes.EXTENSION_WEB_DIRS.items(): self.app.add_routes([ web.static('/extensions/' + urllib.parse.quote(name), dir), ]) self.app.add_routes([ web.static('/', self.web_root), ])
- modify to:
def add_routes(self): routes_names = [] fin_routes = [] for r in self.routes: if r.method+r.path in routes_names: print(f"[Duplicate route(s)]: {r.method} {r.path}") else: fin_routes.append(r) routes_names.append(r.method+r.path) final_routes = RouteTableDef() final_routes._items = fin_routes self.user_manager.add_routes(final_routes) # self.user_manager.add_routes(self.routes) self.app.add_routes(final_routes) # self.app.add_routes(self.routes) for name, dir in nodes.EXTENSION_WEB_DIRS.items(): self.app.add_routes([ web.static('/extensions/' + urllib.parse.quote(name), dir), ]) self.app.add_routes([ web.static('/', self.web_root), ])
2. Add
from aiohttp.web_routedef import RouteTableDef
in theserver.py
Then you can see which guy wrote bug(s).
I had the error too, and I get the code. but ... new err come: final_routes = RouteTableDef() NameError: name 'RouteTableDef' is not defined where from the 'RouteTableDef()'?
ye~ I get it ! take it : from aiohttp.web import RouteTableDef
Traceback (most recent call last): File "F:\AI\LCM\ComfyUI\ComfyUI\main.py", line 220, in
server.add_routes()
File "F:\AI\LCM\ComfyUI\ComfyUI\server.py", line 538, in add_routes
self.app.add_routes(self.routes)
File "F:\AI\LCM\ComfyUI\python_embeded\Lib\site-packages\aiohttp\web_app.py", line 373, in add_routes
return self.router.add_routes(routes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\AI\LCM\ComfyUI\python_embeded\Lib\site-packages\aiohttp\web_urldispatcher.py", line 1202, in add_routes
registered_routes.extend(route_def.register(self))
^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\AI\LCM\ComfyUI\python_embeded\Lib\site-packages\aiohttp\web_routedef.py", line 76, in register
return [reg(self.path, self.handler, self.kwargs)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\AI\LCM\ComfyUI\python_embeded\Lib\site-packages\aiohttp\web_urldispatcher.py", line 1168, in add_post
return self.add_route(hdrs.METH_POST, path, handler, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\AI\LCM\ComfyUI\python_embeded\Lib\site-packages\aiohttp\web_urldispatcher.py", line 1103, in add_route
return resource.add_route(method, handler, expect_handler=expect_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\AI\LCM\ComfyUI\python_embeded\Lib\site-packages\aiohttp\web_urldispatcher.py", line 352, in add_route
raise RuntimeError(
RuntimeError: Added route will never be executed, method POST is already registered
I tried restarting my computer but still couldn't run it.