From faa054d4b412a724071c6bd10d5a965d0a8a962e Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 9 Dec 2024 23:22:47 -0800 Subject: [PATCH] fix: comfyui cfg setting --- backend/open_webui/apps/images/main.py | 2 +- src/lib/components/admin/Settings/Images.svelte | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/apps/images/main.py b/backend/open_webui/apps/images/main.py index 34c2d0656..14209df2f 100644 --- a/backend/open_webui/apps/images/main.py +++ b/backend/open_webui/apps/images/main.py @@ -117,7 +117,7 @@ class OpenAIConfigForm(BaseModel): class Automatic1111ConfigForm(BaseModel): AUTOMATIC1111_BASE_URL: str AUTOMATIC1111_API_AUTH: str - AUTOMATIC1111_CFG_SCALE: Optional[str] + AUTOMATIC1111_CFG_SCALE: Optional[str | float | int] AUTOMATIC1111_SAMPLER: Optional[str] AUTOMATIC1111_SCHEDULER: Optional[str] diff --git a/src/lib/components/admin/Settings/Images.svelte b/src/lib/components/admin/Settings/Images.svelte index c76e192bf..b0492f24b 100644 --- a/src/lib/components/admin/Settings/Images.svelte +++ b/src/lib/components/admin/Settings/Images.svelte @@ -105,10 +105,15 @@ }; const updateConfigHandler = async () => { - const res = await updateConfig(localStorage.token, config).catch((error) => { - toast.error(error); - return null; - }); + const res = await updateConfig(localStorage.token, config) + .catch((error) => { + toast.error(error); + return null; + }) + .catch((error) => { + toast.error(error); + return null; + }); if (res) { config = res;