mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-19 00:47:01 +08:00
Add filename prompt
This commit is contained in:
parent
334aab05e5
commit
af079193a7
@ -519,12 +519,16 @@ export class ComfyUI {
|
||||
$el("button", {
|
||||
textContent: "Save",
|
||||
onclick: () => {
|
||||
const filename = prompt("Save as...", "workflow");
|
||||
if (!filename) {
|
||||
return;
|
||||
}
|
||||
const json = JSON.stringify(app.graph.serialize(), null, 2); // convert the data to a JSON string
|
||||
const blob = new Blob([json], { type: "application/json" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = $el("a", {
|
||||
href: url,
|
||||
download: "workflow.json",
|
||||
download: `${filename}.json`,
|
||||
style: { display: "none" },
|
||||
parent: document.body,
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user