From 53e22f03a80c06bd98c92e583b02f337e34638e9 Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Sun, 21 Dec 2025 06:02:22 +0900 Subject: [PATCH] [backport cloud/1.35] Make node inputs reactive in vue (#7681) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #7546 to `cloud/1.35` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7681-backport-cloud-1-35-Make-node-inputs-reactive-in-vue-2cf6d73d36508197b6f0fd5683f07eec) by [Unito](https://www.unito.io) Co-authored-by: AustinMroz --- src/composables/graph/useGraphNodeManager.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/composables/graph/useGraphNodeManager.ts b/src/composables/graph/useGraphNodeManager.ts index 73a71bb37..9bb1598ba 100644 --- a/src/composables/graph/useGraphNodeManager.ts +++ b/src/composables/graph/useGraphNodeManager.ts @@ -226,6 +226,15 @@ export function useGraphNodeManager(graph: LGraph): GraphNodeManager { reactiveWidgets.splice(0, reactiveWidgets.length, ...v) } }) + const reactiveInputs = shallowReactive(node.inputs ?? []) + Object.defineProperty(node, 'inputs', { + get() { + return reactiveInputs + }, + set(v) { + reactiveInputs.splice(0, reactiveInputs.length, ...v) + } + }) const safeWidgets = reactiveComputed(() => { node.inputs?.forEach((input, index) => { @@ -260,7 +269,7 @@ export function useGraphNodeManager(graph: LGraph): GraphNodeManager { badges, hasErrors: !!node.has_errors, widgets: safeWidgets, - inputs: node.inputs ? [...node.inputs] : undefined, + inputs: reactiveInputs, outputs: node.outputs ? [...node.outputs] : undefined, flags: node.flags ? { ...node.flags } : undefined, color: node.color || undefined,