diff --git a/pyproject.toml b/pyproject.toml index 7c41f81..6ba7bb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "kaytool" description ="KayTool nodes is designed to enhance the efficiency of building ComfyUI workflows. It includes a variety of practical nodes: support for efficient models like BiRefNet and RemBG for background removal and mask post-processing, wireless data transfer (Set & Get ), AI translation (Tencent and Baidu), dynamic mathematical operations, image processing (size extraction, color adjustment, background removal, mask blurring and expansion), flexible text handling, precision sliders, advanced image saving with metadata support, and more." -version = "0.21.7" +version = "0.21.10" license = {file = "LICENSE"} dependencies = ["rembg"] diff --git a/web/setget.js b/web/setget.js index 985be45..e5240fa 100644 --- a/web/setget.js +++ b/web/setget.js @@ -46,7 +46,7 @@ app.registerExtension({ (s) => { node.validateName(node.graph); if (this.widgets[0].value !== '') { - this.title = "πŸ›œSet_" + this.widgets[0].value; + this.title = "𝙆 πŸ›œOut_" + this.widgets[0].value; } this.update(); this.properties.previousName = this.widgets[0].value; @@ -55,22 +55,17 @@ app.registerExtension({ ); this.addInput("*", "*"); - this.addOutput("*", '*'); this.onConnectionsChange = function (slotType, slot, isChangeConnect, link_info) { - if (slotType === 1 && !isChangeConnect) { // Disconnect + if (slotType === 1 && !isChangeConnect) { if (this.inputs[slot].name === '') { this.inputs[slot].type = '*'; this.inputs[slot].name = '*'; - this.title = "πŸ›œSet"; + this.title = "𝙆 πŸ›œOut"; this.widgets[0].value = ''; } } - if (slotType === 2 && !isChangeConnect) { - this.outputs[slot].type = '*'; - this.outputs[slot].name = '*'; - } - if (link_info && node.graph && slotType === 1 && isChangeConnect) { // Connect + if (link_info && node.graph && slotType === 1 && isChangeConnect) { const fromNode = node.graph._nodes.find((n) => n.id === link_info.origin_id); if (fromNode && fromNode.outputs && fromNode.outputs[link_info.origin_slot]) { const type = fromNode.outputs[link_info.origin_slot].type; @@ -80,16 +75,6 @@ app.registerExtension({ showAlert("Node input undefined."); } } - if (link_info && node.graph && slotType === 2 && isChangeConnect) { - const fromNode = node.graph._nodes.find((n) => n.id === link_info.origin_id); - if (fromNode && fromNode.inputs && fromNode.inputs[link_info.origin_slot]) { - const type = fromNode.inputs[link_info.origin_slot].type; - this.outputs[0].type = type; - this.outputs[0].name = type; - } else { - showAlert("Node output undefined."); - } - } this.update(); }; @@ -109,7 +94,7 @@ app.registerExtension({ tries++; } this.widgets[0].value = widgetValue; - this.title = "πŸ›œSet_" + widgetValue; + this.title = "𝙆 πŸ›œOut_" + widgetValue; this.update(); } }; @@ -155,8 +140,20 @@ app.registerExtension({ getExtraMenuOptions(_, options) { const getters = this.findGetters(this.graph); - if (getters.length) { - let gettersSubmenu = getters.map(getter => ({ + if (getters.length === 1) { + + options.unshift({ + content: "Go to πŸ›œ In", + callback: () => { + const getter = getters[0]; + this.canvas.centerOnNode(getter); + this.canvas.selectNode(getter, false); + this.canvas.setDirty(true, true); + }, + }); + } else if (getters.length > 1) { + + let inNodesSubmenu = getters.map(getter => ({ content: `${getter.title} id: ${getter.id}`, callback: () => { this.canvas.centerOnNode(getter); @@ -165,16 +162,16 @@ app.registerExtension({ }, })); options.unshift({ - content: "Getters", + content: "πŸ›œ In Nodes", has_submenu: true, - submenu: { title: "GetNodes", options: gettersSubmenu } + submenu: { title: "πŸ›œ In Nodes", options: inNodesSubmenu } }); } } } LiteGraph.registerNodeType("KaySetNode", Object.assign(KaySetNode, { - title: "πŸ›œSet" + title: "𝙆 πŸ›œOut" })); KaySetNode.category = "KayTool"; @@ -222,7 +219,7 @@ app.registerExtension({ if (setter) { const linkType = setter.inputs[0].type; this.setType(linkType); - this.title = "πŸ›œGet_" + setter.widgets[0].value; + this.title = "𝙆 πŸ›œIn_" + setter.widgets[0].value; } else { this.setType('*'); } @@ -280,14 +277,14 @@ app.registerExtension({ getExtraMenuOptions(_, options) { options.unshift({ - content: "Go to setter", + content: "Go to πŸ›œ Out", callback: () => this.goToSetter(), }); } } LiteGraph.registerNodeType("KayGetNode", Object.assign(KayGetNode, { - title: "πŸ›œGet" + title: "𝙆 πŸ›œIn" })); KayGetNode.category = "KayTool"; },