From b8c0a72eae82314a67ff2ebe8b6fc6dfecc6dd48 Mon Sep 17 00:00:00 2001 From: DrJKL Date: Fri, 19 Apr 2024 13:59:09 -0700 Subject: [PATCH] Node titles for unique/repeated --- src_web/comfyui/fast_node_muter.ts | 5 ++++- web/comfyui/fast_node_muter.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src_web/comfyui/fast_node_muter.ts b/src_web/comfyui/fast_node_muter.ts index deb7b37..e0a47b6 100644 --- a/src_web/comfyui/fast_node_muter.ts +++ b/src_web/comfyui/fast_node_muter.ts @@ -143,5 +143,8 @@ app.registerExtension({ function nodeWithIndex(nodes: LGraphNode[], node: LGraphNode): string { const { title } = node; const sameNameNodes = nodes.filter((n) => n.title === title); - return `${title} ${sameNameNodes.indexOf(node)}`; + if (sameNameNodes.length === 1) { + return title; + } + return `${title} ${sameNameNodes.indexOf(node) + 1}/${sameNameNodes.length}`; } diff --git a/web/comfyui/fast_node_muter.js b/web/comfyui/fast_node_muter.js index 8636a3e..3abfcb3 100644 --- a/web/comfyui/fast_node_muter.js +++ b/web/comfyui/fast_node_muter.js @@ -104,5 +104,8 @@ app.registerExtension({ function nodeWithIndex(nodes, node) { const { title } = node; const sameNameNodes = nodes.filter((n) => n.title === title); - return `${title} ${sameNameNodes.indexOf(node)}`; + if (sameNameNodes.length === 1) { + return title; + } + return `${title} ${sameNameNodes.indexOf(node) + 1}/${sameNameNodes.length}`; }