refac
This commit is contained in:
1 parent
b3255a3656
commit
4d11553a6b
1 file changed
+26
-57
@@ -26,7 +26,7 @@
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
const i18n: any = getContext('i18n');
|
||||
|
||||
let loading = false;
|
||||
|
||||
@@ -616,16 +616,11 @@
|
||||
</div>
|
||||
|
||||
{#if config.COMFYUI_WORKFLOW}
|
||||
<div class="mb-2.5">
|
||||
<div class="flex w-full justify-between items-center">
|
||||
<div class="text-xs pr-2 shrink-0">
|
||||
<div class="">
|
||||
{$i18n.t('ComfyUI Workflow Nodes')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-1 text-xs flex flex-col gap-1.5">
|
||||
<AdminSettingField
|
||||
label={$i18n.t('ComfyUI Workflow Nodes')}
|
||||
description={$i18n.t('Map workflow node inputs used for image generation.')}
|
||||
>
|
||||
<div class="flex flex-col gap-1.5 text-xs">
|
||||
{#each REQUIRED_WORKFLOW_NODES as node}
|
||||
<div class="flex w-full flex-col">
|
||||
<div class="shrink-0">
|
||||
@@ -638,7 +633,7 @@
|
||||
<div class="">
|
||||
<Tooltip content={$i18n.t('Input Key (e.g. text, unet_name, steps)')}>
|
||||
<input
|
||||
class="py-1 w-24 text-xs border border-gray-100/50 !bg-gray-50/40 outline-hidden dark:border-white/[0.04] dark:!bg-white/[0.03] dark:text-gray-300"
|
||||
class="{inputClass} w-24"
|
||||
placeholder={$i18n.t('Key')}
|
||||
bind:value={node.key}
|
||||
required
|
||||
@@ -654,7 +649,7 @@
|
||||
placement="top-start"
|
||||
>
|
||||
<input
|
||||
class="w-full py-1 text-xs border border-gray-100/50 !bg-gray-50/40 outline-hidden dark:border-white/[0.04] dark:!bg-white/[0.03] dark:text-gray-300"
|
||||
class={inputClass}
|
||||
placeholder={$i18n.t('Node Ids')}
|
||||
bind:value={node.node_ids}
|
||||
/>
|
||||
@@ -668,7 +663,7 @@
|
||||
<div class="mt-1 text-xs text-gray-400 dark:text-gray-500">
|
||||
{$i18n.t('*Prompt node ID(s) are required for image generation')}
|
||||
</div>
|
||||
</div>
|
||||
</AdminSettingField>
|
||||
{/if}
|
||||
{:else if config?.IMAGE_GENERATION_ENGINE === 'gemini'}
|
||||
<AdminSettingField
|
||||
@@ -860,7 +855,9 @@
|
||||
/>
|
||||
<AdminSettingRow
|
||||
label={$i18n.t('ComfyUI Workflow')}
|
||||
description={$i18n.t('Upload a workflow.json file exported as API format from ComfyUI.')}
|
||||
description={$i18n.t(
|
||||
'Upload a workflow.json file exported as API format from ComfyUI.'
|
||||
)}
|
||||
>
|
||||
<div class="flex items-center justify-end gap-2">
|
||||
{#if config.IMAGES_EDIT_COMFYUI_WORKFLOW}
|
||||
@@ -906,16 +903,11 @@
|
||||
</div>
|
||||
|
||||
{#if config.IMAGES_EDIT_COMFYUI_WORKFLOW}
|
||||
<div class="mb-2.5">
|
||||
<div class="flex w-full justify-between items-center">
|
||||
<div class="text-xs pr-2 shrink-0">
|
||||
<div class="">
|
||||
{$i18n.t('ComfyUI Workflow Nodes')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-1 text-xs flex flex-col gap-1.5">
|
||||
<AdminSettingField
|
||||
label={$i18n.t('ComfyUI Workflow Nodes')}
|
||||
description={$i18n.t('Map workflow node inputs used for image edits.')}
|
||||
>
|
||||
<div class="flex flex-col gap-1.5 text-xs">
|
||||
{#each REQUIRED_EDIT_WORKFLOW_NODES as node}
|
||||
<div class="flex w-full flex-col">
|
||||
<div class="shrink-0">
|
||||
@@ -928,7 +920,7 @@
|
||||
<div class="">
|
||||
<Tooltip content={$i18n.t('Input Key (e.g. text, unet_name, steps)')}>
|
||||
<input
|
||||
class="py-1 w-24 text-xs border border-gray-100/50 !bg-gray-50/40 outline-hidden dark:border-white/[0.04] dark:!bg-white/[0.03] dark:text-gray-300"
|
||||
class="{inputClass} w-24"
|
||||
placeholder={$i18n.t('Key')}
|
||||
bind:value={node.key}
|
||||
required
|
||||
@@ -944,7 +936,7 @@
|
||||
placement="top-start"
|
||||
>
|
||||
<input
|
||||
class="w-full py-1 text-xs border border-gray-100/50 !bg-gray-50/40 outline-hidden dark:border-white/[0.04] dark:!bg-white/[0.03] dark:text-gray-300"
|
||||
class={inputClass}
|
||||
placeholder={$i18n.t('Node Ids')}
|
||||
bind:value={node.node_ids}
|
||||
/>
|
||||
@@ -958,49 +950,26 @@
|
||||
<div class="mt-1 text-xs text-gray-400 dark:text-gray-500">
|
||||
{$i18n.t('*Prompt node ID(s) are required for image generation')}
|
||||
</div>
|
||||
</div>
|
||||
</AdminSettingField>
|
||||
{/if}
|
||||
{:else if config?.IMAGE_EDIT_ENGINE === 'gemini'}
|
||||
<div class="mb-2.5">
|
||||
<div class="flex w-full justify-between items-center">
|
||||
<div class="text-xs pr-2 shrink-0">
|
||||
<div class="">
|
||||
{$i18n.t('Gemini Base URL')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex w-full">
|
||||
<div class="flex-1">
|
||||
<div class="grid grid-cols-1 gap-2 sm:grid-cols-2">
|
||||
<AdminSettingField label={$i18n.t('Base URL')}>
|
||||
<input
|
||||
class="w-full text-xs border border-gray-100/50 !bg-gray-50/40 outline-hidden dark:border-white/[0.04] dark:!bg-white/[0.03] dark:text-gray-300 text-right"
|
||||
class={inputClass}
|
||||
placeholder={$i18n.t('API Base URL')}
|
||||
bind:value={config.IMAGES_EDIT_GEMINI_API_BASE_URL}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AdminSettingField>
|
||||
|
||||
<div class="mb-2.5">
|
||||
<div class="flex w-full justify-between items-center">
|
||||
<div class="text-xs pr-2 shrink-0">
|
||||
<div class="">
|
||||
{$i18n.t('Gemini API Key')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex w-full">
|
||||
<div class="flex-1">
|
||||
<AdminSettingField label={$i18n.t('API Key')}>
|
||||
<SensitiveInput
|
||||
variant="settings"
|
||||
inputClassName="text-right w-full"
|
||||
placeholder={$i18n.t('API Key')}
|
||||
bind:value={config.IMAGES_EDIT_GEMINI_API_KEY}
|
||||
required={true}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AdminSettingField>
|
||||
</div>
|
||||
{/if}
|
||||
</AdminSettingSection>
|
||||
|
||||
Reference in new issue
Block a user