mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-19 01:27:01 +08:00
make work on old python
This commit is contained in:
parent
a68a846f6f
commit
11c00dd8f5
@ -268,7 +268,12 @@ class PromptServer():
|
|||||||
@routes.get("/workflows")
|
@routes.get("/workflows")
|
||||||
async def get_workflows(request):
|
async def get_workflows(request):
|
||||||
dir = folder_paths.get_workflows_directory()
|
dir = folder_paths.get_workflows_directory()
|
||||||
files = glob.glob('**/*.json', root_dir=dir, recursive=True)
|
files = []
|
||||||
|
for dirpath, directories, file in os.walk(dir):
|
||||||
|
for file in file:
|
||||||
|
print(directories, file)
|
||||||
|
if(file.endswith(".json")):
|
||||||
|
files.append(os.path.relpath(os.path.join(dirpath, file), dir))
|
||||||
return web.json_response(list(map(lambda f: os.path.splitext(f)[0].replace("\\", "/"), files)))
|
return web.json_response(list(map(lambda f: os.path.splitext(f)[0].replace("\\", "/"), files)))
|
||||||
|
|
||||||
@routes.get("/workflows/{name:.+}")
|
@routes.get("/workflows/{name:.+}")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user