mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-19 10:37:00 +08:00
Models/Samplers endpoint
This commit is contained in:
parent
8bbd9815a9
commit
28c6bf0f6a
11
server.py
11
server.py
@ -22,6 +22,7 @@ except ImportError:
|
||||
|
||||
import mimetypes
|
||||
from comfy.cli_args import args
|
||||
from comfy.samplers import KSampler
|
||||
|
||||
|
||||
@web.middleware
|
||||
@ -108,6 +109,16 @@ class PromptServer():
|
||||
embeddings = folder_paths.get_filename_list("embeddings")
|
||||
return web.json_response(list(map(lambda a: os.path.splitext(a)[0].lower(), embeddings)))
|
||||
|
||||
@routes.get("/checkpoints")
|
||||
def get_checkpoints(self):
|
||||
checkpoints = folder_paths.get_filename_list("checkpoints")
|
||||
return web.json_response(list(map(lambda a: a.lower(), checkpoints)))
|
||||
|
||||
@routes.get("/samplers")
|
||||
def get_samplers(self):
|
||||
samplers = KSampler.SAMPLERS
|
||||
return web.json_response(samplers)
|
||||
|
||||
@routes.get("/extensions")
|
||||
async def get_extensions(request):
|
||||
files = glob.glob(os.path.join(self.web_root, 'extensions/**/*.js'), recursive=True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user