Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Added save image menu item

pythongosssss0b6ba21f52e1
diff --git a/web/scripts/app.js b/web/scripts/app.js
index 3f06629ee..dc61c5a66 100644
--- a/web/scripts/app.js
+++ b/web/scripts/app.js
@@ -80,10 +80,23 @@ class ComfyApp {
img = this.imgs[this.overIndex];
}
if (img) {
- options.unshift({
- content: "Open Image",
- callback: () => window.open(img.src, "_blank"),
- });
+ options.unshift(
+ {
+ 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());
+ },
+ }
+ );
}
}
};