1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 15:04:50 +08:00

Updated a1111 pnginfo importer, supports:

- model name, other basic settings
 - clip skip
 - hr upscale
 - loras
 - embeddings
This commit is contained in:
pythongosssss
2023-03-12 21:36:42 +00:00
parent 6d6758e9e4
commit 85989c74e5
4 changed files with 285 additions and 3 deletions

View File

@@ -73,6 +73,14 @@ class PromptServer():
async def get_root(request):
return web.FileResponse(os.path.join(self.web_root, "index.html"))
@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)
return web.json_response(list(map(lambda a: os.path.splitext(a)[0].lower(), embeddings)))
@routes.get("/extensions")
async def get_extensions(request):
files = glob.glob(os.path.join(self.web_root, 'extensions/**/*.js'), recursive=True)