mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-08 13:20:50 +08:00
Add API endpoint to get samplers
This commit is contained in:
parent
bbd683098e
commit
7e781171f9
@ -26,6 +26,7 @@ import mimetypes
|
|||||||
from comfy.cli_args import args
|
from comfy.cli_args import args
|
||||||
import comfy.utils
|
import comfy.utils
|
||||||
import comfy.model_management
|
import comfy.model_management
|
||||||
|
from comfy.samplers import SAMPLER_NAMES
|
||||||
from comfy_api import feature_flags
|
from comfy_api import feature_flags
|
||||||
import node_helpers
|
import node_helpers
|
||||||
from comfyui_version import __version__
|
from comfyui_version import __version__
|
||||||
@ -286,6 +287,10 @@ class PromptServer():
|
|||||||
|
|
||||||
return web.json_response(extensions)
|
return web.json_response(extensions)
|
||||||
|
|
||||||
|
@routes.get("/samplers")
|
||||||
|
def get_samplers(request):
|
||||||
|
return web.json_response(sorted(SAMPLER_NAMES))
|
||||||
|
|
||||||
def get_dir_by_type(dir_type):
|
def get_dir_by_type(dir_type):
|
||||||
if dir_type is None:
|
if dir_type is None:
|
||||||
dir_type = "input"
|
dir_type = "input"
|
||||||
@ -366,7 +371,6 @@ class PromptServer():
|
|||||||
post = await request.post()
|
post = await request.post()
|
||||||
return image_upload(post)
|
return image_upload(post)
|
||||||
|
|
||||||
|
|
||||||
@routes.post("/upload/mask")
|
@routes.post("/upload/mask")
|
||||||
async def upload_mask(request):
|
async def upload_mask(request):
|
||||||
post = await request.post()
|
post = await request.post()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user