mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-20 03:13:30 +00:00
Merge branch 'saveimage' of https://github.com/pythongosssss/ComfyUI
This commit is contained in:
commit
451447bd9f
@ -80,10 +80,23 @@ class ComfyApp {
|
|||||||
img = this.imgs[this.overIndex];
|
img = this.imgs[this.overIndex];
|
||||||
}
|
}
|
||||||
if (img) {
|
if (img) {
|
||||||
options.unshift({
|
options.unshift(
|
||||||
content: "Open Image",
|
{
|
||||||
callback: () => window.open(img.src, "_blank"),
|
content: "Open Image",
|
||||||
});
|
callback: () => window.open(img.src, "_blank"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
content: "Save Image",
|
||||||
|
callback: () => {
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = img.src;
|
||||||
|
a.setAttribute("download", new URLSearchParams(new URL(img.src).search).get("filename"));
|
||||||
|
document.body.append(a);
|
||||||
|
a.click();
|
||||||
|
requestAnimationFrame(() => a.remove());
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user