diff --git a/src/components/graph/NodeTitleEditor.vue b/src/components/graph/NodeTitleEditor.vue index a667c1d7e..322abac2c 100644 --- a/src/components/graph/NodeTitleEditor.vue +++ b/src/components/graph/NodeTitleEditor.vue @@ -15,6 +15,9 @@ import { LGraphNode } from '@comfyorg/litegraph' import { ComfyExtension } from '@/types/comfy' import EditableText from '@/components/common/EditableText.vue' import { LiteGraph } from '@comfyorg/litegraph' +import { useSettingStore } from '@/stores/settingStore' + +const settingStore = useSettingStore() const showInput = ref(false) const editedTitle = ref('') @@ -43,6 +46,10 @@ const extension: ComfyExtension = { const originalCallback = node.onNodeTitleDblClick node.onNodeTitleDblClick = function (e: MouseEvent, ...args: any[]) { + if (!settingStore.get('Comfy.Node.DoubleClickTitleToEdit')) { + return + } + currentNode.value = this editedTitle.value = this.title showInput.value = true diff --git a/src/stores/settingStore.ts b/src/stores/settingStore.ts index 83fcd0dab..79d878bbf 100644 --- a/src/stores/settingStore.ts +++ b/src/stores/settingStore.ts @@ -252,6 +252,13 @@ export const useSettingStore = defineStore('setting', { max: 100 } }) + + app.ui.settings.addSetting({ + id: 'Comfy.Node.DoubleClickTitleToEdit', + name: 'Double click node title to edit', + type: 'boolean', + defaultValue: true + }) }, set(key: K, value: Settings[K]) { diff --git a/src/types/apiTypes.ts b/src/types/apiTypes.ts index 5ea96315a..ac4a0f9d5 100644 --- a/src/types/apiTypes.ts +++ b/src/types/apiTypes.ts @@ -465,7 +465,8 @@ const zSettings = z.record(z.any()).and( 'Comfy.Workflow.SortNodeIdOnSave': z.boolean(), 'Comfy.Queue.ImageFit': z.enum(['contain', 'cover']), 'Comfy.Workflow.ModelDownload.AllowedSources': z.array(z.string()), - 'Comfy.Workflow.ModelDownload.AllowedSuffixes': z.array(z.string()) + 'Comfy.Workflow.ModelDownload.AllowedSuffixes': z.array(z.string()), + 'Comfy.Node.DoubleClickTitleToEdit': z.boolean() }) .optional() )