Skip to content

Commit

Permalink
Node titles for unique/repeated
Browse files Browse the repository at this point in the history
  • Loading branch information
DrJKL committed Apr 21, 2024
1 parent 37048d8 commit c9ad0f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src_web/comfyui/fast_node_muter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
5 changes: 4 additions & 1 deletion web/comfyui/fast_node_muter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}

0 comments on commit c9ad0f3

Please sign in to comment.