From 50ee9cab57e5fe9c898c1d649e8b294debf931f5 Mon Sep 17 00:00:00 2001 From: missionfloyd Date: Fri, 14 Apr 2023 17:55:52 -0600 Subject: [PATCH] Make filename prompt optional --- web/scripts/ui.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/web/scripts/ui.js b/web/scripts/ui.js index c23a573d8..420814078 100644 --- a/web/scripts/ui.js +++ b/web/scripts/ui.js @@ -430,6 +430,13 @@ export class ComfyUI { type: "boolean", defaultValue: true, }); + + const filenamePrompt = this.settings.addSetting({ + id: "Comfy.FilenamePrompt", + name: "Prompt for filename when saving", + type: "boolean", + defaultValue: true, + }); const fileInput = $el("input", { type: "file", @@ -519,9 +526,12 @@ export class ComfyUI { $el("button", { textContent: "Save", onclick: () => { - const filename = prompt("Save as...", "workflow"); - if (!filename) { - return; + let filename = "workflow"; + if (filenamePrompt.value) { + 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" });