From 6c746ab5fc0c1a3fa29fc18c548c02b94f42ac95 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 7 Apr 2023 15:08:44 -0400 Subject: [PATCH 01/20] ComfyUI fixes for mobile stuff. --- src/litegraph.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index 2881c4901..37a7c12ae 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -107,7 +107,7 @@ node_box_coloured_when_on: false, // [true!] this make the nodes box (top left circle) coloured when triggered (execute/action), visual feedback node_box_coloured_by_mode: false, // [true!] nodebox based on node mode, visual feedback - dialog_close_on_mouse_leave: true, // [false on mobile] better true if not touch device, TODO add an helper/listener to close if false + dialog_close_on_mouse_leave: false, // [false on mobile] better true if not touch device, TODO add an helper/listener to close if false dialog_close_on_mouse_leave_delay: 500, shift_click_do_break_link_from: false, // [false!] prefer false if results too easy to break links - implement with ALT or TODO custom keys @@ -137,7 +137,7 @@ release_link_on_empty_shows_menu: false, //[true!] dragging a link to empty space will open a menu, add from list, search or defaults - pointerevents_method: "mouse", // "mouse"|"pointer" use mouse for retrocompatibility issues? (none found @ now) + pointerevents_method: "pointer", // "mouse"|"pointer" use mouse for retrocompatibility issues? (none found @ now) // TODO implement pointercancel, gotpointercapture, lostpointercapture, (pointerover, pointerout if necessary) ctrl_shift_v_paste_connect_unselected_outputs: false, //[true!] allows ctrl + shift + v to paste nodes with the outputs of the unselected nodes connected with the inputs of the newly pasted nodes @@ -5865,7 +5865,7 @@ LGraphNode.prototype.executeAction = function(action) var skip_action = false; var now = LiteGraph.getTime(); var is_primary = (e.isPrimary === undefined || !e.isPrimary); - var is_double_click = (now - this.last_mouseclick < 300) && is_primary; + var is_double_click = (now - this.last_mouseclick < 300); this.mouse[0] = e.clientX; this.mouse[1] = e.clientY; this.graph_mouse[0] = e.canvasX; From db34e87d6c088f859af384af204bf312b2536e3b Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 7 Apr 2023 23:07:44 -0400 Subject: [PATCH 02/20] Allow dragging again. --- src/litegraph.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index 37a7c12ae..6ffe07f60 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -7581,8 +7581,8 @@ LGraphNode.prototype.executeAction = function(action) clientY_rel = e.clientY; } - // e.deltaX = clientX_rel - this.last_mouse_position[0]; - // e.deltaY = clientY_rel- this.last_mouse_position[1]; + e.deltaX = clientX_rel - this.last_mouse_position[0]; + e.deltaY = clientY_rel- this.last_mouse_position[1]; this.last_mouse_position[0] = clientX_rel; this.last_mouse_position[1] = clientY_rel; @@ -10044,7 +10044,14 @@ LGraphNode.prototype.executeAction = function(action) case "number": case "combo": var old_value = w.value; - if (event.type == LiteGraph.pointerevents_method+"move" && w.type == "number") { + var delta = x < 40 ? -1 : x > widget_width - 40 ? 1 : 0; + var allow_scroll = true; + if (delta) { + if (x > -3 && x < widget_width + 3) { + allow_scroll = false; + } + } + if (allow_scroll && event.type == LiteGraph.pointerevents_method+"move" && w.type == "number") { if(event.deltaX) w.value += event.deltaX * 0.1 * (w.options.step || 1); if ( w.options.min != null && w.value < w.options.min ) { From 4e0670ffb1a49fec8eff09d0b03480eb30095561 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 10 Apr 2023 02:42:35 -0400 Subject: [PATCH 03/20] litegraph dev forgot to remove the title height from the collision if it's hidden --- src/litegraph.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index 6ffe07f60..bf9b573b1 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -1654,7 +1654,8 @@ var nRet = null; for (var i = nodes_list.length - 1; i >= 0; i--) { var n = nodes_list[i]; - if (n.isPointInside(x, y, margin)) { + var skip_title = n.constructor.title_mode == LiteGraph.NO_TITLE; + if (n.isPointInside(x, y, margin, skip_title)) { // check for lesser interest nodes (TODO check for overlapping, use the top) /*if (typeof n == "LGraphGroup"){ nRet = n; From 59192b8a58c3c3b749f68c12118323995f3a8545 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Wed, 12 Apr 2023 17:59:03 -0400 Subject: [PATCH 04/20] enable new CTRL-SHIFT-V --- src/litegraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index bf9b573b1..61801b470 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -140,7 +140,7 @@ pointerevents_method: "pointer", // "mouse"|"pointer" use mouse for retrocompatibility issues? (none found @ now) // TODO implement pointercancel, gotpointercapture, lostpointercapture, (pointerover, pointerout if necessary) - ctrl_shift_v_paste_connect_unselected_outputs: false, //[true!] allows ctrl + shift + v to paste nodes with the outputs of the unselected nodes connected with the inputs of the newly pasted nodes + ctrl_shift_v_paste_connect_unselected_outputs: true, //[true!] allows ctrl + shift + v to paste nodes with the outputs of the unselected nodes connected with the inputs of the newly pasted nodes // if true, all newly created nodes/links will use string UUIDs for their id fields instead of integers. // use this if you must have node IDs that are unique across all graphs and subgraphs. From 8cc3cd39d9f0abd874405cea2b143c6d43c10577 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sat, 29 Apr 2023 20:49:56 -0400 Subject: [PATCH 05/20] Make nodes easier to resize. --- src/litegraph.js | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index 61801b470..c318cbc83 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -3658,6 +3658,18 @@ return size; }; + LGraphNode.prototype.inResizeCorner = function(canvasX, canvasY) { + var rows = this.outputs ? this.outputs.length : 1; + var outputs_offset = (this.constructor.slot_start_y || 0) + rows * LiteGraph.NODE_SLOT_HEIGHT; + return isInsideRectangle(canvasX, + canvasY, + this.pos[0] + this.size[0] - 15, + this.pos[1] + Math.max(this.size[1] - 15, outputs_offset), + 20, + 20 + ); + } + /** * returns all the info available about a property of this node. * @@ -5939,14 +5951,7 @@ LGraphNode.prototype.executeAction = function(action) if ( this.allow_interaction && !this.connecting_node && !node.flags.collapsed && !this.live_mode ) { //Search for corner for resize if ( !skip_action && - node.resizable !== false && - isInsideRectangle( e.canvasX, - e.canvasY, - node.pos[0] + node.size[0] - 5, - node.pos[1] + node.size[1] - 5, - 10, - 10 - ) + node.resizable !== false && node.inResizeCorner(e.canvasX, e.canvasY) ) { this.graph.beforeChange(); this.resizing_node = node; @@ -6490,16 +6495,7 @@ LGraphNode.prototype.executeAction = function(action) //Search for corner if (this.canvas) { - if ( - isInsideRectangle( - e.canvasX, - e.canvasY, - node.pos[0] + node.size[0] - 5, - node.pos[1] + node.size[1] - 5, - 5, - 5 - ) - ) { + if (node.inResizeCorner(e.canvasX, e.canvasY)) { this.canvas.style.cursor = "se-resize"; } else { this.canvas.style.cursor = "crosshair"; From adbbc53fa4dc60cb9073c8061fdc631a4934ce15 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sat, 3 Jun 2023 11:45:42 -0400 Subject: [PATCH 06/20] Move properties panel from double click to menu option. --- src/litegraph.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index c318cbc83..c24d81a7a 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -7362,10 +7362,6 @@ LGraphNode.prototype.executeAction = function(action) if (this.onShowNodePanel) { this.onShowNodePanel(n); } - else - { - this.showShowNodePanel(n); - } if (this.onNodeDblClicked) { this.onNodeDblClicked(n); @@ -13143,6 +13139,10 @@ LGraphNode.prototype.executeAction = function(action) has_submenu: true, callback: LGraphCanvas.onShowMenuNodeProperties }, + { + content: "Properties Panel", + callback: function(item, options, e, menu, node) { LGraphCanvas.active_canvas.showShowNodePanel(node) } + }, null, { content: "Title", From 8e6be3c8de42d4e8247e7483fdd9fac8b1d06872 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Tue, 11 Jul 2023 03:00:14 -0400 Subject: [PATCH 07/20] Put PR #386 in right file. --- src/litegraph.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/litegraph.js b/src/litegraph.js index c24d81a7a..dc51ed6e8 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -6085,6 +6085,9 @@ LGraphNode.prototype.executeAction = function(action) //it wasn't clicked on the links boxes if (!skip_action) { var block_drag_node = false; + if(node && node.flags && node.flags.pinned) { + block_drag_node = true; + } var pos = [e.canvasX - node.pos[0], e.canvasY - node.pos[1]]; //widgets From 41050752dd778bdd4f21141bc296f9e50ba8bbde Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Tue, 11 Jul 2023 03:10:15 -0400 Subject: [PATCH 08/20] Fix for high DPI. --- src/litegraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index dc51ed6e8..e78f2080c 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -8219,7 +8219,7 @@ LGraphNode.prototype.executeAction = function(action) **/ LGraphCanvas.prototype.renderInfo = function(ctx, x, y) { x = x || 10; - y = y || this.canvas.height - 80; + y = y || this.canvas.offsetHeight - 80; ctx.save(); ctx.translate(x, y); From 864d0f1270b99de8e01c0d7c59bed3b80d63f793 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Wed, 12 Jul 2023 02:03:10 -0400 Subject: [PATCH 09/20] Add back roundRect so firefox ESR can work again. --- src/litegraph.js | 76 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/src/litegraph.js b/src/litegraph.js index e78f2080c..bda8c59b5 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -13419,6 +13419,82 @@ LGraphNode.prototype.executeAction = function(action) }; //API ************************************************* + //like rect but rounded corners + if (typeof(window) != "undefined" && window.CanvasRenderingContext2D && !window.CanvasRenderingContext2D.prototype.roundRect) { + window.CanvasRenderingContext2D.prototype.roundRect = function( + x, + y, + w, + h, + radius, + radius_low + ) { + var top_left_radius = 0; + var top_right_radius = 0; + var bottom_left_radius = 0; + var bottom_right_radius = 0; + + if ( radius === 0 ) + { + this.rect(x,y,w,h); + return; + } + + if(radius_low === undefined) + radius_low = radius; + + //make it compatible with official one + if(radius != null && radius.constructor === Array) + { + if(radius.length == 1) + top_left_radius = top_right_radius = bottom_left_radius = bottom_right_radius = radius[0]; + else if(radius.length == 2) + { + top_left_radius = bottom_right_radius = radius[0]; + top_right_radius = bottom_left_radius = radius[1]; + } + else if(radius.length == 4) + { + top_left_radius = radius[0]; + top_right_radius = radius[1]; + bottom_left_radius = radius[2]; + bottom_right_radius = radius[3]; + } + else + return; + } + else //old using numbers + { + top_left_radius = radius || 0; + top_right_radius = radius || 0; + bottom_left_radius = radius_low || 0; + bottom_right_radius = radius_low || 0; + } + + //top right + this.moveTo(x + top_left_radius, y); + this.lineTo(x + w - top_right_radius, y); + this.quadraticCurveTo(x + w, y, x + w, y + top_right_radius); + + //bottom right + this.lineTo(x + w, y + h - bottom_right_radius); + this.quadraticCurveTo( + x + w, + y + h, + x + w - bottom_right_radius, + y + h + ); + + //bottom left + this.lineTo(x + bottom_right_radius, y + h); + this.quadraticCurveTo(x, y + h, x, y + h - bottom_left_radius); + + //top left + this.lineTo(x, y + bottom_left_radius); + this.quadraticCurveTo(x, y, x + top_left_radius, y); + }; + }//if + function compareObjects(a, b) { for (var i in a) { if (a[i] != b[i]) { From a525552030dd4c9d3329ec9b729d7c6061ce12e6 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 31 Aug 2023 02:24:39 -0400 Subject: [PATCH 10/20] Fix litegraph button being black on light theme. --- src/litegraph.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/litegraph.js b/src/litegraph.js index bda8c59b5..1c1ac79e3 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -9794,6 +9794,7 @@ LGraphNode.prototype.executeAction = function(action) switch (w.type) { case "button": + ctx.fillStyle = background_color; if (w.clicked) { ctx.fillStyle = "#AAA"; w.clicked = false; From fb126fff4f901e1816da9e73a02be3add900752f Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 31 Aug 2023 02:38:51 -0400 Subject: [PATCH 11/20] Fix middle mouse drag. --- src/litegraph.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index 1c1ac79e3..867c58580 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -6257,11 +6257,13 @@ LGraphNode.prototype.executeAction = function(action) ,posAdd:[!mClikSlot_isOut?-30:30, -alphaPosY*130] //-alphaPosY*30] ,posSizeFix:[!mClikSlot_isOut?-1:0, 0] //-alphaPosY*2*/ }); - + skip_action = true; } } } - } else if (!skip_action && this.allow_dragcanvas) { + } + + if (!skip_action && this.allow_dragcanvas) { //console.log("pointerevents: dragging_canvas start from middle button"); this.dragging_canvas = true; } From 3a3a51cfcd92d1025fab53f0e381ffb05d4622a7 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Wed, 20 Sep 2023 13:23:35 -0400 Subject: [PATCH 12/20] Lower search timeout. --- src/litegraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index 867c58580..0d6e32019 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -11553,7 +11553,7 @@ LGraphNode.prototype.executeAction = function(action) if (timeout) { clearInterval(timeout); } - timeout = setTimeout(refreshHelper, 250); + timeout = setTimeout(refreshHelper, 10); return; } e.preventDefault(); From f71e6f3106455c41913f93e191a7ac5417f83079 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:15:11 +0000 Subject: [PATCH 13/20] allow nodes to be specified when copying (#3) --- src/litegraph.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/litegraph.js b/src/litegraph.js index 0d6e32019..63a5ce9d0 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -7132,15 +7132,16 @@ LGraphNode.prototype.executeAction = function(action) } }; - LGraphCanvas.prototype.copyToClipboard = function() { + LGraphCanvas.prototype.copyToClipboard = function(nodes) { var clipboard_info = { nodes: [], links: [] }; var index = 0; var selected_nodes_array = []; - for (var i in this.selected_nodes) { - var node = this.selected_nodes[i]; + if (!nodes) nodes = this.selected_nodes; + for (var i in nodes) { + var node = nodes[i]; if (node.clonable === false) continue; node._relative_id = index; From a9d6ff977f0722d251790f08d60cbc30b383495c Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 23 Nov 2023 01:08:21 -0500 Subject: [PATCH 14/20] Fix group loading. --- src/litegraph.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index 63a5ce9d0..767506af8 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -4952,7 +4952,9 @@ LGraphNode.prototype.executeAction = function(action) this.title = o.title; this._bounding.set(o.bounding); this.color = o.color; - this.font_size = o.font_size; + if (o.font_size) { + this.font_size = o.font_size; + } }; LGraphGroup.prototype.serialize = function() { From 6a0e0124751e433dc17cbbddb414308f017a9594 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 21 Dec 2023 13:18:23 -0500 Subject: [PATCH 15/20] Increase maximum number of nodes to 10k. --- src/litegraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index 767506af8..5e44b0405 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -46,7 +46,7 @@ EVENT_LINK_COLOR: "#A86", CONNECTING_LINK_COLOR: "#AFA", - MAX_NUMBER_OF_NODES: 1000, //avoid infinite loops + MAX_NUMBER_OF_NODES: 10000, //avoid infinite loops DEFAULT_POSITION: [100, 100], //default node position VALID_SHAPES: ["default", "box", "round", "card"], //,"circle" From eec3575df5ceaf292b6ffeb79d9ee1c4f4377cee Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 21 Dec 2023 13:18:52 -0500 Subject: [PATCH 16/20] Auto select value in prompt. --- src/litegraph.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/litegraph.js b/src/litegraph.js index 5e44b0405..45c14e08e 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -11360,6 +11360,7 @@ LGraphNode.prototype.executeAction = function(action) name_element.innerText = title; var value_element = dialog.querySelector(".value"); value_element.value = value; + value_element.select(); var input = value_element; input.addEventListener("keydown", function(e) { From 208eb2d006a1b1b80c4fa8f753d23194183ce12c Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Wed, 24 Jan 2024 00:48:42 +0000 Subject: [PATCH 17/20] Support custom hide timeout on node search dialog (#4) --- src/litegraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index 45c14e08e..d12689b0c 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -11494,7 +11494,7 @@ LGraphNode.prototype.executeAction = function(action) } timeout_close = setTimeout(function() { dialog.close(); - }, 500); + }, typeof options.hide_on_mouse_leave === "number" ? options.hide_on_mouse_leave : 500); }); // if filtering, check focus changed to comboboxes and prevent closing if (options.do_type_filter){ From 5925961fa15f41dcf8f8265d051785b83b126645 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Wed, 31 Jan 2024 03:24:37 +0000 Subject: [PATCH 18/20] Show node title in search and also search title (#5) Fix long types overflowing dialog --- css/litegraph.css | 13 +++++++++++++ src/litegraph.js | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/css/litegraph.css b/css/litegraph.css index 918858f41..5524e24ba 100755 --- a/css/litegraph.css +++ b/css/litegraph.css @@ -184,6 +184,7 @@ color: white; padding-left: 10px; margin-right: 5px; + max-width: 300px; } .litegraph.litesearchbox .name { @@ -227,6 +228,18 @@ color: black; } +.litegraph.lite-search-item-type { + display: inline-block; + background: rgba(0,0,0,0.2); + margin-left: 5px; + font-size: 14px; + padding: 2px 5px; + position: relative; + top: -2px; + opacity: 0.8; + border-radius: 4px; + } + /* DIALOGs ******/ .litegraph .dialog { diff --git a/src/litegraph.js b/src/litegraph.js index d12689b0c..cb2091f12 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -11908,7 +11908,7 @@ LGraphNode.prototype.executeAction = function(action) var ctor = LiteGraph.registered_node_types[ type ]; if(filter && ctor.filter != filter ) return false; - if ((!options.show_all_if_empty || str) && type.toLowerCase().indexOf(str) === -1) + if ((!options.show_all_if_empty || str) && type.toLowerCase().indexOf(str) === -1 && (!ctor.title || ctor.title.toLowerCase().indexOf(str) === -1)) return false; // filter by slot IN, OUT types @@ -11962,7 +11962,18 @@ LGraphNode.prototype.executeAction = function(action) if (!first) { first = type; } - help.innerText = type; + + const nodeType = LiteGraph.registered_node_types[type]; + if (nodeType?.title) { + help.innerText = nodeType?.title; + const typeEl = document.createElement("span"); + typeEl.className = "litegraph lite-search-item-type"; + typeEl.textContent = type; + help.append(typeEl); + } else { + help.innerText = type; + } + help.dataset["type"] = escape(type); help.className = "litegraph lite-search-item"; if (className) { From 49a3e31402eb9a0ce91e55c1af4aa4aa35fc9764 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:27:29 +0000 Subject: [PATCH 19/20] Fix using enter to select item (#6) --- src/litegraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index cb2091f12..091ec170b 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -11547,7 +11547,7 @@ LGraphNode.prototype.executeAction = function(action) dialog.close(); } else if (e.keyCode == 13) { if (selected) { - select(selected.innerHTML); + select(unescape(selected.dataset["type"])); } else if (first) { select(first); } else { From c608227c3c4f4e21695f55422b6b13068373b512 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 5 Apr 2024 15:20:35 -0400 Subject: [PATCH 20/20] Fix links sometimes not being correct when copy pasting nodes. --- src/litegraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index 091ec170b..7e14924cd 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -7245,7 +7245,7 @@ LGraphNode.prototype.executeAction = function(action) //create links for (var i = 0; i < clipboard_info.links.length; ++i) { var link_info = clipboard_info.links[i]; - var origin_node; + var origin_node = undefined; var origin_node_relative_id = link_info[0]; if (origin_node_relative_id != null) { origin_node = nodes[origin_node_relative_id];