Add route to list model types (#4846)
* Add list models route * Better readable model types list
This commit is contained in:
parent
254838f23c
commit
7183fd1665
|
@ -222,6 +222,12 @@ class PromptServer():
|
|||
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):
|
||||
folder = request.match_info.get("folder", None)
|
||||
|
|
Loading…
Reference in New Issue