Skip to content

Commit

Permalink
Update litegraph to latest.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Nov 13, 2023
1 parent 7339479 commit eb0407e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions web/lib/litegraph.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,7 @@
var w = this.widgets[i];
if(!w)
continue;
if(w.options && w.options.property && this.properties[ w.options.property ])
if(w.options && w.options.property && (this.properties[ w.options.property ] != undefined))
w.value = JSON.parse( JSON.stringify( this.properties[ w.options.property ] ) );
}
if (info.widgets_values) {
Expand Down Expand Up @@ -4928,9 +4928,7 @@ LGraphNode.prototype.executeAction = function(action)
this.title = o.title;
this._bounding.set(o.bounding);
this.color = o.color;
if (o.font_size) {
this.font_size = o.font_size;
}
this.font_size = o.font_size;
};

LGraphGroup.prototype.serialize = function() {
Expand Down Expand Up @@ -5714,10 +5712,10 @@ LGraphNode.prototype.executeAction = function(action)
* @method enableWebGL
**/
LGraphCanvas.prototype.enableWebGL = function() {
if (typeof GL === undefined) {
if (typeof GL === "undefined") {
throw "litegl.js must be included to use a WebGL canvas";
}
if (typeof enableWebGLCanvas === undefined) {
if (typeof enableWebGLCanvas === "undefined") {
throw "webglCanvas.js must be included to use this feature";
}

Expand Down Expand Up @@ -7110,15 +7108,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;
Expand Down Expand Up @@ -11702,7 +11701,7 @@ LGraphNode.prototype.executeAction = function(action)
default:
iS = 0; // try with first if no name set
}
if (typeof options.node_from.outputs[iS] !== undefined){
if (typeof options.node_from.outputs[iS] !== "undefined"){
if (iS!==false && iS>-1){
options.node_from.connectByType( iS, node, options.node_from.outputs[iS].type );
}
Expand Down Expand Up @@ -11730,7 +11729,7 @@ LGraphNode.prototype.executeAction = function(action)
default:
iS = 0; // try with first if no name set
}
if (typeof options.node_to.inputs[iS] !== undefined){
if (typeof options.node_to.inputs[iS] !== "undefined"){
if (iS!==false && iS>-1){
// try connection
options.node_to.connectByTypeOutput(iS,node,options.node_to.inputs[iS].type);
Expand Down

0 comments on commit eb0407e

Please sign in to comment.