From 7183fd1665e88c13184a11d7ec06f56307b4fa7f Mon Sep 17 00:00:00 2001 From: Tom <88888824+ImDarkTom@users.noreply.github.com> Date: Tue, 17 Sep 2024 09:22:05 +0100 Subject: [PATCH] Add route to list model types (#4846) * Add list models route * Better readable model types list --- server.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.py b/server.py index a2c078e4..e370e246 100644 --- a/server.py +++ b/server.py @@ -221,6 +221,12 @@ class PromptServer(): def get_embeddings(self): embeddings = folder_paths.get_filename_list("embeddings") return web.json_response(list(map(lambda a: os.path.splitext(a)[0], embeddings))) + + @routes.get("/models") + def list_model_types(request): + model_types = list(folder_paths.folder_names_and_paths.keys()) + + return web.json_response(model_types) @routes.get("/models/{folder}") async def get_models(request):