From 1d6d805587c06847d9518ccab79fe780aba8d1a6 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sun, 25 Oct 2026 00:32:26 +0200 Subject: [PATCH] fix: image engine settings show while image generation is off (#32985) * fix: image engine settings show while image generation is off Settings > Images showed the image engine, its credentials and the whole image edit section even with image generation turned off. They now only show while the Image Generation switch is on, and flipping it on shows them right away, so everything can be set up before saving. Stored engine settings and keys are kept. Refs #32830 * fix: saving image settings without a required key turns image generation off Saving Settings > Images with Image Generation on but a required URL or API key empty showed an "is required" error and flipped the switch back off, which now also hid the field that needed filling. The switch now stays on with the error, so the missing value can be filled in and saved right away. Nothing is saved until then. Refs #32830 * refac: always require the Gemini API key while image generation is on The key field only shows while image generation is on, so it is simply required now. * refac: drop the stray blank lines left in the image settings save checks Each missing-setting check now shows its error and stops right away, with no leftover gap from the removed lines. --- .../components/admin/Settings/Images.svelte | 1250 ++++++++--------- 1 file changed, 624 insertions(+), 626 deletions(-) diff --git a/src/lib/components/admin/Settings/Images.svelte b/src/lib/components/admin/Settings/Images.svelte index eb0a596fcb..d96da48af4 100644 --- a/src/lib/components/admin/Settings/Images.svelte +++ b/src/lib/components/admin/Settings/Images.svelte @@ -114,29 +114,21 @@ config.AUTOMATIC1111_BASE_URL === '' ) { toast.error($i18n.t('AUTOMATIC1111 Base URL is required.')); - config.ENABLE_IMAGE_GENERATION = false; - return null; } else if (config.IMAGE_GENERATION_ENGINE === 'comfyui' && config.COMFYUI_BASE_URL === '') { toast.error($i18n.t('ComfyUI Base URL is required.')); - config.ENABLE_IMAGE_GENERATION = false; - return null; } else if ( config.IMAGE_GENERATION_ENGINE === 'openai' && config.IMAGES_OPENAI_API_KEY === '' ) { toast.error($i18n.t('OpenAI API Key is required.')); - config.ENABLE_IMAGE_GENERATION = false; - return null; } else if ( config.IMAGE_GENERATION_ENGINE === 'gemini' && config.IMAGES_GEMINI_API_KEY === '' ) { toast.error($i18n.t('Gemini API Key is required.')); - config.ENABLE_IMAGE_GENERATION = false; - return null; } } @@ -344,23 +336,23 @@ - - - + - - - - - - + + + + + + + - {#if config.ENABLE_IMAGE_GENERATION}
- {/if} - {#if config?.IMAGE_GENERATION_ENGINE === 'openai'} -
+ {#if config?.IMAGE_GENERATION_ENGINE === 'openai'} +
+ + + + + + + +
+ + + + + +