mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
@@ -210,7 +210,14 @@ def get_schedulers():
|
||||
"""List all available schedulers with their class names and options."""
|
||||
from modules.sd_samplers import list_samplers
|
||||
all_schedulers = list_samplers()
|
||||
return all_schedulers
|
||||
return [
|
||||
{
|
||||
'name': scheduler.name,
|
||||
'cls': scheduler.constructor.__name__ if scheduler.constructor is not None else None,
|
||||
'options': scheduler.options,
|
||||
}
|
||||
for scheduler in all_schedulers
|
||||
]
|
||||
|
||||
def post_unload_checkpoint():
|
||||
"""Unload the current model and refiner from memory to free VRAM."""
|
||||
@@ -331,6 +338,8 @@ def get_file(file: str):
|
||||
import os
|
||||
from pathlib import Path
|
||||
from starlette.responses import FileResponse
|
||||
if shared.demo is None:
|
||||
raise HTTPException(status_code=503, detail="server not ready")
|
||||
allowed_dirs = shared.demo.allowed_paths
|
||||
if not file.strip():
|
||||
raise HTTPException(status_code=400, detail="file path is required")
|
||||
@@ -345,6 +354,8 @@ def get_file(file: str):
|
||||
def get_deletefile(file: str):
|
||||
import os
|
||||
from pathlib import Path
|
||||
if shared.demo is None:
|
||||
raise HTTPException(status_code=503, detail="server not ready")
|
||||
allowed_dirs = shared.demo.allowed_paths
|
||||
if file is None or len(file.strip()) == 0:
|
||||
raise HTTPException(status_code=400, detail="file path is required")
|
||||
@@ -368,6 +379,8 @@ def get_deletefile(file: str):
|
||||
def get_deleteimage(file: str):
|
||||
import os
|
||||
from pathlib import Path
|
||||
if shared.demo is None:
|
||||
raise HTTPException(status_code=503, detail="server not ready")
|
||||
allowed_dirs = shared.demo.allowed_paths
|
||||
if file is None or len(file.strip()) == 0:
|
||||
raise HTTPException(status_code=400, detail="file path is required")
|
||||
|
||||
Reference in New Issue
Block a user