mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 00:20:07 +00:00
added Download node
This commit is contained in:
@@ -715,7 +715,8 @@
|
||||
|
||||
function DownloadData() {
|
||||
this.size = [60, 30];
|
||||
this.addInput("value", 0, { label: "" });
|
||||
this.addInput("data", 0 );
|
||||
this.addInput("download", LiteGraph.ACTION );
|
||||
this.properties = { filename: "data.json" };
|
||||
this.value = null;
|
||||
var that = this;
|
||||
@@ -752,6 +753,11 @@
|
||||
setTimeout( function(){ URL.revokeObjectURL( url ); }, 1000*60 ); //wait one minute to revoke url
|
||||
}
|
||||
|
||||
DownloadData.prototype.onAction = function(action, param) {
|
||||
var that = this;
|
||||
setTimeout( function(){ that.downloadAsFile(); }, 100); //deferred to avoid blocking the renderer with the popup
|
||||
}
|
||||
|
||||
DownloadData.prototype.onExecute = function() {
|
||||
if (this.inputs[0]) {
|
||||
this.value = this.getInputData(0);
|
||||
|
||||
Reference in New Issue
Block a user