{ loading = true; await updateOpenAIKey(localStorage.token, OPENAI_API_KEY); await updateDefaultImageGenerationModel(localStorage.token, selectedModel); await updateDefaultImageGenerationModel(localStorage.token, selectedModel); await updateImageSize(localStorage.token, imageSize).catch((error) => { toast.error(error); return null; }); await updateImageSteps(localStorage.token, steps).catch((error) => { toast.error(error); return null; }); dispatch('save'); loading = false; }} >
Image Settings
Image Generation Engine
{ await updateImageGeneration(); }} >
Default (Automatic1111)
Open AI (Dall-E)
Image Generation (Experimental)
{ if (imageGenerationEngine === '' && AUTOMATIC1111_BASE_URL === '') { toast.error('AUTOMATIC1111 Base URL is required.'); enableImageGeneration = false; } else { enableImageGeneration = !enableImageGeneration; } updateImageGeneration(); }} type="button" > {#if enableImageGeneration === true}
On
{:else}
Off
{/if}
{#if imageGenerationEngine === ''}
AUTOMATIC1111 Base URL
{ // updateOllamaAPIUrlHandler(); updateAUTOMATIC1111UrlHandler(); }} >
Include `--api` flag when running stable-diffusion-webui
(e.g. `sh webui.sh --api`)
{:else if imageGenerationEngine === 'openai'}
OpenAI API Key
{/if} {#if enableImageGeneration}
Set Default Model
{#if !selectedModel}
Select a model
{/if} {#each models ?? [] as model}
{model.name}
{/each}
Set Image Size
Set Steps
{/if}
Save {#if loading}
{/if}