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