More options for AUTOMATIC1111

This commit adds 3 new options to the AUTOMATIC1111 settings:
- CFG Scale
- Sampler
- Scheduler

These options allow users to configure these parameters directly through the admin settings, without needing to modify the source code, which was previously required to change the default values in  AUTOMATIC1111.

Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
Balazs Toldi
2024-09-07 17:21:17 +02:00
parent 2544f7eaf0
commit 7f6dae41f0
4 changed files with 119 additions and 0 deletions
@@ -27,6 +27,10 @@
let models = null;
let samplers = ["DPM++ 2M", "DPM++ SDE", "DPM++ 2M SDE", "DPM++ 2M SDE Heun", "DPM++ 2S a", "DPM++ 3M SDE", "Euler a", "Euler", "LMS", "Heun", "DPM2", "DPM2 a", "DPM fast", "DPM adaptive", "Restart", "DDIM", "DDIM CFG++", "PLMS", "UniPC"];
let schedulers = ["Automatic", "Uniform", "Karras", "Exponential", "Polyexponential", "SGM Uniform", "KL Optimal", "Align Your Steps", "Simple", "Normal", "DDIM", "Beta"];
let requiredWorkflowNodes = [
{
type: 'prompt',
@@ -326,6 +330,66 @@
</a>
</div>
</div>
<!---Sampler-->
<div>
<div class=" mb-2.5 text-sm font-medium">{$i18n.t('Set Sampler')}</div>
<div class="flex w-full">
<div class="flex-1 mr-2">
<Tooltip content={$i18n.t('Enter Sampler (e.g. Euler a)')} placement="top-start">
<input
list="sampler-list"
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
placeholder={$i18n.t('Enter Sampler (e.g. Euler a)')}
bind:value={config.automatic1111.AUTOMATIC1111_SAMPLER}
/>
<datalist id="sampler-list">
{#each samplers ?? [] as sampler}
<option value={sampler}>{sampler}</option>
{/each}
</datalist>
</Tooltip>
</div>
</div>
</div>
<!---Scheduler-->
<div>
<div class=" mb-2.5 text-sm font-medium">{$i18n.t('Set Scheduler')}</div>
<div class="flex w-full">
<div class="flex-1 mr-2">
<Tooltip content={$i18n.t('Enter Scheduler (e.g. Karras)')} placement="top-start">
<input
list="scheduler-list"
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
placeholder={$i18n.t('Enter Scheduler (e.g. Karras)')}
bind:value={config.automatic1111.AUTOMATIC1111_SCHEDULER}
/>
<datalist id="scheduler-list">
{#each schedulers ?? [] as scheduler}
<option value={scheduler}>{scheduler}</option>
{/each}
</datalist>
</Tooltip>
</div>
</div>
</div>
<!---CFG scale-->
<div>
<div class=" mb-2.5 text-sm font-medium">{$i18n.t('Set CFG Scale')}</div>
<div class="flex w-full">
<div class="flex-1 mr-2">
<Tooltip content={$i18n.t('Enter CFG Scale (e.g. 7.0)')} placement="top-start">
<input
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
placeholder={$i18n.t('Enter CFG Scale (e.g. 7.0)')}
bind:value={config.automatic1111.AUTOMATIC1111_CFG_SCALE}
/>
</Tooltip>
</div>
</div>
</div>
{:else if config?.engine === 'comfyui'}
<div class="">
<div class=" mb-2 text-sm font-medium">{$i18n.t('ComfyUI Base URL')}</div>
@@ -238,6 +238,7 @@
"Enter a detail about yourself for your LLMs to recall": "",
"Enter api auth string (e.g. username:password)": "",
"Enter Brave Search API Key": "",
"Enter CFG Scale (e.g. 7.0)": "",
"Enter Chunk Overlap": "",
"Enter Chunk Size": "",
"Enter Github Raw URL": "",
@@ -248,6 +249,8 @@
"Enter Model ID": "",
"Enter model tag (e.g. {{modelTag}})": "",
"Enter Number of Steps (e.g. 50)": "",
"Enter Sampler (e.g. Euler a)": "",
"Enter Scheduler (e.g. Karras)": "",
"Enter Score": "",
"Enter SearchApi API Key": "",
"Enter SearchApi Engine": "",
@@ -574,10 +577,13 @@
"Serpstack API Key": "",
"Server connection verified": "",
"Set as default": "",
"Set CFG Scale": "",
"Set Default Model": "",
"Set embedding model (e.g. {{model}})": "",
"Set Image Size": "",
"Set reranking model (e.g. {{model}})": "",
"Set Sampler": "",
"Set Scheduler": "",
"Set Steps": "",
"Set Task Model": "",
"Set Voice": "",