mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-03-16 14:27:05 +08:00
Make SaveImageKJ work with prefix replacement
This commit is contained in:
parent
1a39ccde72
commit
6eb9211091
@ -2332,7 +2332,7 @@ class SaveImageKJ:
|
|||||||
|
|
||||||
OUTPUT_NODE = True
|
OUTPUT_NODE = True
|
||||||
|
|
||||||
CATEGORY = "image"
|
CATEGORY = "KJNodes/image"
|
||||||
DESCRIPTION = "Saves the input images to your ComfyUI output directory."
|
DESCRIPTION = "Saves the input images to your ComfyUI output directory."
|
||||||
|
|
||||||
def save_images(self, images, output_folder, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None, caption=None, caption_file_extension=".txt"):
|
def save_images(self, images, output_folder, filename_prefix="ComfyUI", prompt=None, extra_pnginfo=None, caption=None, caption_file_extension=".txt"):
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { app } from "../../../scripts/app.js";
|
import { app } from "../../../scripts/app.js";
|
||||||
|
import { applyTextReplacements } from "../../../scripts/utils.js";
|
||||||
|
|
||||||
app.registerExtension({
|
app.registerExtension({
|
||||||
name: "KJNodes.jsnodes",
|
name: "KJNodes.jsnodes",
|
||||||
@ -335,6 +336,17 @@ app.registerExtension({
|
|||||||
this.addWidget("button", "Stop mic capture", null, stopMicrophoneCapture);
|
this.addWidget("button", "Stop mic capture", null, stopMicrophoneCapture);
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
case "SaveImageKJ":
|
||||||
|
const onNodeCreated = nodeType.prototype.onNodeCreated;
|
||||||
|
nodeType.prototype.onNodeCreated = function() {
|
||||||
|
const r = onNodeCreated ? onNodeCreated.apply(this, arguments) : void 0;
|
||||||
|
const widget = this.widgets.find((w) => w.name === "filename_prefix");
|
||||||
|
widget.serializeValue = () => {
|
||||||
|
return applyTextReplacements(app, widget.value);
|
||||||
|
};
|
||||||
|
return r;
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user