chore: format

This commit is contained in:
Timothy J. Baek 2024-09-13 00:49:23 -04:00
parent bebc0d2073
commit 7df997c992
2 changed files with 19 additions and 9 deletions

View File

@ -145,9 +145,21 @@ async def update_config(form_data: ConfigForm, user=Depends(get_admin_user)):
form_data.automatic1111.AUTOMATIC1111_API_AUTH form_data.automatic1111.AUTOMATIC1111_API_AUTH
) )
app.state.config.AUTOMATIC1111_CFG_SCALE = float(form_data.automatic1111.AUTOMATIC1111_CFG_SCALE) if form_data.automatic1111.AUTOMATIC1111_CFG_SCALE != "" else None app.state.config.AUTOMATIC1111_CFG_SCALE = (
app.state.config.AUTOMATIC1111_SAMPLER = form_data.automatic1111.AUTOMATIC1111_SAMPLER if form_data.automatic1111.AUTOMATIC1111_SAMPLER != "" else None float(form_data.automatic1111.AUTOMATIC1111_CFG_SCALE)
app.state.config.AUTOMATIC1111_SCHEDULER = form_data.automatic1111.AUTOMATIC1111_SCHEDULER if form_data.automatic1111.AUTOMATIC1111_SCHEDULER != "" else None if form_data.automatic1111.AUTOMATIC1111_CFG_SCALE != ""
else None
)
app.state.config.AUTOMATIC1111_SAMPLER = (
form_data.automatic1111.AUTOMATIC1111_SAMPLER
if form_data.automatic1111.AUTOMATIC1111_SAMPLER != ""
else None
)
app.state.config.AUTOMATIC1111_SCHEDULER = (
form_data.automatic1111.AUTOMATIC1111_SCHEDULER
if form_data.automatic1111.AUTOMATIC1111_SCHEDULER != ""
else None
)
app.state.config.COMFYUI_BASE_URL = form_data.comfyui.COMFYUI_BASE_URL.strip("/") app.state.config.COMFYUI_BASE_URL = form_data.comfyui.COMFYUI_BASE_URL.strip("/")
app.state.config.COMFYUI_WORKFLOW = form_data.comfyui.COMFYUI_WORKFLOW app.state.config.COMFYUI_WORKFLOW = form_data.comfyui.COMFYUI_WORKFLOW
@ -285,7 +297,6 @@ async def update_image_config(form_data: ImageConfigForm, user=Depends(get_admin
detail=ERROR_MESSAGES.INCORRECT_FORMAT(" (e.g., 50)."), detail=ERROR_MESSAGES.INCORRECT_FORMAT(" (e.g., 50)."),
) )
return { return {
"MODEL": app.state.config.MODEL, "MODEL": app.state.config.MODEL,
"IMAGE_SIZE": app.state.config.IMAGE_SIZE, "IMAGE_SIZE": app.state.config.IMAGE_SIZE,

View File

@ -1236,8 +1236,7 @@ AUTOMATIC1111_SAMPLER = PersistentConfig(
os.environ.get("AUTOMATIC1111_SAMPLER") os.environ.get("AUTOMATIC1111_SAMPLER")
if os.environ.get("AUTOMATIC1111_SAMPLER") if os.environ.get("AUTOMATIC1111_SAMPLER")
else None else None
) ),
) )
AUTOMATIC1111_SCHEDULER = PersistentConfig( AUTOMATIC1111_SCHEDULER = PersistentConfig(
@ -1247,7 +1246,7 @@ AUTOMATIC1111_SCHEDULER = PersistentConfig(
os.environ.get("AUTOMATIC1111_SCHEDULER") os.environ.get("AUTOMATIC1111_SCHEDULER")
if os.environ.get("AUTOMATIC1111_SCHEDULER") if os.environ.get("AUTOMATIC1111_SCHEDULER")
else None else None
) ),
) )
COMFYUI_BASE_URL = PersistentConfig( COMFYUI_BASE_URL = PersistentConfig(