mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-08-02 23:14:49 +08:00
Added dynamic loading of extensions
This commit is contained in:
@@ -5,6 +5,7 @@ import nodes
|
||||
import execution
|
||||
import uuid
|
||||
import json
|
||||
import glob
|
||||
|
||||
try:
|
||||
import aiohttp
|
||||
@@ -52,6 +53,11 @@ class PromptServer():
|
||||
async def get_root(request):
|
||||
return web.FileResponse(os.path.join(self.web_root, "index.html"))
|
||||
|
||||
@routes.get("/extensions")
|
||||
async def get_extensions(request):
|
||||
files = glob.glob(os.path.join(self.web_root, 'extensions/**/*.js'), recursive=True)
|
||||
return web.json_response(list(map(lambda f: "/" + os.path.relpath(f, self.web_root).replace("\\", "/"), files)))
|
||||
|
||||
@routes.get("/view/{file}")
|
||||
async def view_image(request):
|
||||
if "file" in request.match_info:
|
||||
|
Reference in New Issue
Block a user