mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-06 23:37:10 +08:00
account for multiple custom_nodes paths
This commit is contained in:
parent
1ea319ee07
commit
1f583d2ef1
@ -15,7 +15,11 @@ class CustomNodeManager:
|
|||||||
@routes.get("/workflow_templates")
|
@routes.get("/workflow_templates")
|
||||||
async def get_workflow_templates(request):
|
async def get_workflow_templates(request):
|
||||||
"""Returns a web response that contains the map of custom_nodes names and their associated workflow templates. The ones without templates are omitted."""
|
"""Returns a web response that contains the map of custom_nodes names and their associated workflow templates. The ones without templates are omitted."""
|
||||||
files = glob.glob(os.path.join(folder_paths.get_folder_paths("custom_nodes")[0], '*/example_workflows/*.json'))
|
files = [
|
||||||
|
file
|
||||||
|
for folder in folder_paths.get_folder_paths("custom_nodes")
|
||||||
|
for file in glob.glob(os.path.join(folder, '*/example_workflows/*.json'))
|
||||||
|
]
|
||||||
workflow_templates_dict = {} # custom_nodes folder name -> example workflow names
|
workflow_templates_dict = {} # custom_nodes folder name -> example workflow names
|
||||||
for file in files:
|
for file in files:
|
||||||
custom_nodes_name = os.path.basename(os.path.dirname(os.path.dirname(file)))
|
custom_nodes_name = os.path.basename(os.path.dirname(os.path.dirname(file)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user