diff --git a/src/lib/components/admin/Settings/Images.svelte b/src/lib/components/admin/Settings/Images.svelte index e15991fc7..af89bca1b 100644 --- a/src/lib/components/admin/Settings/Images.svelte +++ b/src/lib/components/admin/Settings/Images.svelte @@ -117,11 +117,16 @@ if (res) { config = res; + if (!config.replicate) { + config.replicate = { + REPLICATE_API_TOKEN: '' + }; + } } if (config.enabled) { backendConfig.set(await getBackendConfig()); - await getModels(); + getModels(); } }; @@ -191,14 +196,8 @@ } } - imageGenerationConfig = await getImageGenerationConfig(localStorage.token).catch((error) => { - toast.error(`${error}`); - return null; - }); - - // Load models first, then they'll be available when the UI renders if (config.enabled) { - await getModels(); + getModels(); } if (config.comfyui.COMFYUI_WORKFLOW) { @@ -224,6 +223,15 @@ node_ids: typeof n.node_ids === 'string' ? n.node_ids : n.node_ids.join(',') }; }); + + const imageConfigRes = await getImageGenerationConfig(localStorage.token).catch((error) => { + toast.error(`${error}`); + return null; + }); + + if (imageConfigRes) { + imageGenerationConfig = imageConfigRes; + } } }); @@ -293,21 +301,18 @@