From 3ff4c155c9e3449e7888f7cb87c4350e8cd68216 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sun, 19 Mar 2023 11:29:03 -0400 Subject: [PATCH] Fix /embeddings route being broken. --- server.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index 32dd3db9..e2d129e3 100644 --- a/server.py +++ b/server.py @@ -2,6 +2,7 @@ import os import sys import asyncio import nodes +import folder_paths import execution import uuid import json @@ -75,10 +76,7 @@ class PromptServer(): @routes.get("/embeddings") def get_embeddings(self): - models_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "models") - embed_dir = os.path.join(models_dir, "embeddings") - embeddings = nodes.filter_files_extensions(nodes.recursive_search(embed_dir), nodes.supported_pt_extensions) - + embeddings = folder_paths.get_filename_list("embeddings") return web.json_response(list(map(lambda a: os.path.splitext(a)[0].lower(), embeddings))) @routes.get("/extensions")