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