mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-19 01:27:01 +08:00
Make filename prompt optional
This commit is contained in:
parent
af079193a7
commit
50ee9cab57
@ -431,6 +431,13 @@ export class ComfyUI {
|
|||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const filenamePrompt = this.settings.addSetting({
|
||||||
|
id: "Comfy.FilenamePrompt",
|
||||||
|
name: "Prompt for filename when saving",
|
||||||
|
type: "boolean",
|
||||||
|
defaultValue: true,
|
||||||
|
});
|
||||||
|
|
||||||
const fileInput = $el("input", {
|
const fileInput = $el("input", {
|
||||||
type: "file",
|
type: "file",
|
||||||
accept: ".json,image/png",
|
accept: ".json,image/png",
|
||||||
@ -519,9 +526,12 @@ export class ComfyUI {
|
|||||||
$el("button", {
|
$el("button", {
|
||||||
textContent: "Save",
|
textContent: "Save",
|
||||||
onclick: () => {
|
onclick: () => {
|
||||||
const filename = prompt("Save as...", "workflow");
|
let filename = "workflow";
|
||||||
if (!filename) {
|
if (filenamePrompt.value) {
|
||||||
return;
|
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" });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user