diff --git a/src/components/dialog/content/SettingDialogContent.vue b/src/components/dialog/content/SettingDialogContent.vue new file mode 100644 index 000000000..c0543dd6b --- /dev/null +++ b/src/components/dialog/content/SettingDialogContent.vue @@ -0,0 +1,116 @@ + + + + + + + {{ setting.name }} + + + + + + + + + + + + + + + + diff --git a/src/components/dialog/content/setting/CustomSettingValue.vue b/src/components/dialog/content/setting/CustomSettingValue.vue new file mode 100644 index 000000000..2b91fa3bf --- /dev/null +++ b/src/components/dialog/content/setting/CustomSettingValue.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/src/components/dialog/content/setting/InputSlider.vue b/src/components/dialog/content/setting/InputSlider.vue new file mode 100644 index 000000000..8c287ac6a --- /dev/null +++ b/src/components/dialog/content/setting/InputSlider.vue @@ -0,0 +1,58 @@ + + + + + + + + + + diff --git a/src/components/sidebar/SideBarSettingsToggleIcon.vue b/src/components/sidebar/SideBarSettingsToggleIcon.vue index 36eb311f5..92e5101a7 100644 --- a/src/components/sidebar/SideBarSettingsToggleIcon.vue +++ b/src/components/sidebar/SideBarSettingsToggleIcon.vue @@ -7,10 +7,16 @@ diff --git a/src/scripts/ui/settings.ts b/src/scripts/ui/settings.ts index 330894acb..a728bafd1 100644 --- a/src/scripts/ui/settings.ts +++ b/src/scripts/ui/settings.ts @@ -185,6 +185,9 @@ export class ComfySettingsDialog extends ComfyDialog { } this.settingsParamLookup[id] = params + if (this.app.vueAppReady) { + useSettingStore().settings[id] = params + } this.settingsLookup[id] = { id, onChange, diff --git a/src/stores/dialogStore.ts b/src/stores/dialogStore.ts index 8395c6085..00bc9834d 100644 --- a/src/stores/dialogStore.ts +++ b/src/stores/dialogStore.ts @@ -2,7 +2,7 @@ // Currently we need to bridge between legacy app code and Vue app with a Pinia store. import { defineStore } from 'pinia' -import { Component } from 'vue' +import { type Component, markRaw } from 'vue' interface DialogState { isVisible: boolean @@ -26,7 +26,7 @@ export const useDialogStore = defineStore('dialog', { props?: Record }) { this.title = options.title - this.component = options.component + this.component = markRaw(options.component) this.props = options.props || {} this.isVisible = true }, diff --git a/src/stores/settingStore.ts b/src/stores/settingStore.ts index 3cc06d8d1..9a24e49f6 100644 --- a/src/stores/settingStore.ts +++ b/src/stores/settingStore.ts @@ -9,15 +9,18 @@ import { app } from '@/scripts/app' import { ComfySettingsDialog } from '@/scripts/ui/settings' +import { SettingParams } from '@/types/settingTypes' import { defineStore } from 'pinia' interface State { settingValues: Record + settings: Record } export const useSettingStore = defineStore('setting', { state: (): State => ({ - settingValues: {} + settingValues: {}, + settings: {} }), actions: { addSettings(settings: ComfySettingsDialog) { @@ -25,6 +28,7 @@ export const useSettingStore = defineStore('setting', { const value = settings.getSettingValue(id) this.settingValues[id] = value } + this.settings = settings.settingsParamLookup }, set(key: string, value: any) {