mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 10:14:06 +00:00
bug fix
This commit is contained in:
@@ -1818,7 +1818,7 @@ LGraphNode.prototype.trigger = function( action, param )
|
||||
var output = this.outputs[ slot ];
|
||||
if(!output || output.type !== LiteGraph.EVENT || (action && output.name != action) )
|
||||
continue;
|
||||
this.triggerSlot( slot, param );
|
||||
this.triggerSlot( i, param );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
build/litegraph.min.js
vendored
2
build/litegraph.min.js
vendored
@@ -39,7 +39,7 @@ null;if(b.outputs)for(c=0;c<b.outputs.length;++c)b.outputs[c].links&&(b.outputs[
|
||||
b}};LGraphNode.prototype.getInputData=function(a,b){if(this.inputs&&!(a>=this.inputs.length||null==this.inputs[a].link)){var c=this.graph.links[this.inputs[a].link];if(!c)return null;if(!b)return c.data;var h=this.graph.getNodeById(c.origin_id);if(!h)return c.data;if(h.updateOutputData)h.updateOutputData(c.origin_slot);else if(h.onExecute)h.onExecute();return c.data}};LGraphNode.prototype.isInputConnected=function(a){return this.inputs?a<this.inputs.length&&null!=this.inputs[a].link:!1};LGraphNode.prototype.getInputInfo=
|
||||
function(a){return this.inputs?a<this.inputs.length?this.inputs[a]:null:null};LGraphNode.prototype.getInputNode=function(a){if(!this.inputs||a>=this.inputs.length)return null;a=this.inputs[a];return a&&a.link?(a=this.graph.links[a.link])?this.graph.getNodeById(a.origin_id):null:null};LGraphNode.prototype.getOutputData=function(a){return!this.outputs||a>=this.outputs.length?null:this.outputs[a]._data};LGraphNode.prototype.getOutputInfo=function(a){return this.outputs?a<this.outputs.length?this.outputs[a]:
|
||||
null:null};LGraphNode.prototype.isOutputConnected=function(a){return this.outputs?a<this.outputs.length&&this.outputs[a].links&&this.outputs[a].links.length:null};LGraphNode.prototype.getOutputNodes=function(a){if(!this.outputs||0==this.outputs.length||a>=this.outputs.length)return null;a=this.outputs[a];if(!a.links||0==a.links.length)return null;for(var b=[],c=0;c<a.links.length;c++){var h=this.graph.links[a.links[c]];h&&(h=this.graph.getNodeById(h.target_id))&&b.push(h)}return b};LGraphNode.prototype.trigger=
|
||||
function(a,b){if(this.outputs&&this.outputs.length){this.graph&&(this.graph._last_trigger_time=k.getTime());for(var c=0;c<this.outputs.length;++c){var h=this.outputs[slot];!h||h.type!==k.EVENT||a&&h.name!=a||this.triggerSlot(slot,b)}}};LGraphNode.prototype.triggerSlot=function(a,b){if(this.outputs){var c=this.outputs[a];if(c&&(c=c.links)&&c.length){this.graph&&(this.graph._last_trigger_time=k.getTime());for(var h=0;h<c.length;++h){var l=this.graph.links[c[h]];if(l){var e=this.graph.getNodeById(l.target_id);
|
||||
function(a,b){if(this.outputs&&this.outputs.length){this.graph&&(this.graph._last_trigger_time=k.getTime());for(var c=0;c<this.outputs.length;++c){var h=this.outputs[slot];!h||h.type!==k.EVENT||a&&h.name!=a||this.triggerSlot(c,b)}}};LGraphNode.prototype.triggerSlot=function(a,b){if(this.outputs){var c=this.outputs[a];if(c&&(c=c.links)&&c.length){this.graph&&(this.graph._last_trigger_time=k.getTime());for(var h=0;h<c.length;++h){var l=this.graph.links[c[h]];if(l){var e=this.graph.getNodeById(l.target_id);
|
||||
if(e)if(l._last_time=k.getTime(),l=e.inputs[l.target_slot],e.onAction)e.onAction(l.name,b);else if(e.mode===k.ON_TRIGGER&&e.onExecute)e.onExecute(b)}}}}};LGraphNode.prototype.addProperty=function(a,b,c,h){c={name:a,type:c,default_value:b};if(h)for(var l in h)c[l]=h[l];this.properties_info||(this.properties_info=[]);this.properties_info.push(c);this.properties||(this.properties={});this.properties[a]=b;return c};LGraphNode.prototype.addOutput=function(a,b,c){a={name:a,type:b,links:null};if(c)for(var h in c)a[h]=
|
||||
c[h];this.outputs||(this.outputs=[]);this.outputs.push(a);if(this.onOutputAdded)this.onOutputAdded(a);this.size=this.computeSize();return a};LGraphNode.prototype.addOutputs=function(a){for(var b=0;b<a.length;++b){var c=a[b],h={name:c[0],type:c[1],link:null};if(a[2])for(var l in c[2])h[l]=c[2][l];this.outputs||(this.outputs=[]);this.outputs.push(h);if(this.onOutputAdded)this.onOutputAdded(h)}this.size=this.computeSize()};LGraphNode.prototype.removeOutput=function(a){this.disconnectOutput(a);this.outputs.splice(a,
|
||||
1);this.size=this.computeSize();if(this.onOutputRemoved)this.onOutputRemoved(a)};LGraphNode.prototype.addInput=function(a,b,c){a={name:a,type:b||0,link:null};if(c)for(var h in c)a[h]=c[h];this.inputs||(this.inputs=[]);this.inputs.push(a);this.size=this.computeSize();if(this.onInputAdded)this.onInputAdded(a);return a};LGraphNode.prototype.addInputs=function(a){for(var b=0;b<a.length;++b){var c=a[b],h={name:c[0],type:c[1],link:null};if(a[2])for(var l in c[2])h[l]=c[2][l];this.inputs||(this.inputs=[]);
|
||||
|
||||
@@ -1817,7 +1817,7 @@ LGraphNode.prototype.trigger = function( action, param )
|
||||
var output = this.outputs[ slot ];
|
||||
if(!output || output.type !== LiteGraph.EVENT || (action && output.name != action) )
|
||||
continue;
|
||||
this.triggerSlot( slot, param );
|
||||
this.triggerSlot( i, param );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,3 +10,4 @@
|
||||
../src/nodes/glfx.js
|
||||
../src/nodes/midi.js
|
||||
../src/nodes/audio.js
|
||||
../src/nodes/network.js
|
||||
|
||||
Reference in New Issue
Block a user