{ saveHandler(); }} >
{#if config && imageGenerationConfig}
{$i18n.t('Image Settings')}
{$i18n.t('Image Generation (Experimental)')}
{ const enabled = e.detail; if (enabled) { if ( config.engine === 'automatic1111' && config.automatic1111.AUTOMATIC1111_BASE_URL === '' ) { toast.error($i18n.t('AUTOMATIC1111 Base URL is required.')); config.enabled = false; } else if ( config.engine === 'comfyui' && config.comfyui.COMFYUI_BASE_URL === '' ) { toast.error($i18n.t('ComfyUI Base URL is required.')); config.enabled = false; } else if (config.engine === 'openai' && config.openai.OPENAI_API_KEY === '') { toast.error($i18n.t('OpenAI API Key is required.')); config.enabled = false; } } updateConfigHandler(); }} />
{$i18n.t('Image Generation Engine')}
{ updateConfigHandler(); }} >
{$i18n.t('Default (Open AI)')}
{$i18n.t('ComfyUI')}
{$i18n.t('Automatic1111')}
{#if (config?.engine ?? 'automatic1111') === 'automatic1111'}
{$i18n.t('AUTOMATIC1111 Base URL')}
{ updateConfigHandler(); }} >
{$i18n.t('Include `--api` flag when running stable-diffusion-webui')}
{$i18n.t('(e.g. `sh webui.sh --api`)')}
{$i18n.t('AUTOMATIC1111 Api Auth String')}
{$i18n.t('Include `--api-auth` flag when running stable-diffusion-webui')}
{$i18n .t('(e.g. `sh webui.sh --api --api-auth username_password`)') .replace('_', ':')}
{:else if config?.engine === 'comfyui'}
{$i18n.t('ComfyUI Base URL')}
{ updateConfigHandler(); }} >
{$i18n.t('ComfyUI Workflow')}
{#if config.comfyui.COMFYUI_WORKFLOW}
{/if}
{ const file = e.target.files[0]; const reader = new FileReader(); reader.onload = (e) => { config.comfyui.COMFYUI_WORKFLOW = e.target.result; updateConfigHandler(); e.target.value = null; }; reader.readAsText(file); }} />
{ document.getElementById('upload-comfyui-workflow-input')?.click(); }} > {$i18n.t('Click here to upload a workflow.json file.')}
{$i18n.t('Make sure to export a workflow.json file as API format from ComfyUI.')}
{#if config.comfyui.COMFYUI_WORKFLOW}
{$i18n.t('ComfyUI Workflow Nodes')}
{#each workflowNodes as node}
{node.type}
{/each}
{/if} {:else if config?.engine === 'openai'}
{$i18n.t('OpenAI API Config')}
{/if}
{#if config?.enabled}
{$i18n.t('Set Default Model')}
{#each models ?? [] as model}
{model.name}
{/each}
{$i18n.t('Set Image Size')}
{$i18n.t('Set Steps')}
{/if} {/if}
{$i18n.t('Save')} {#if loading}
{/if}