KJNodes/imagegenerated

Save Image KJ(SaveImageKJ)

This node is based on ComfyUI's folder path management system, which can convert the input image tensor into common image formats (such as PNG) and write them to the specified directory.

Save Image KJ

images
filename
filename_prefix
ComfyUI
output_folder
output
caption_file_extension
.txt
caption
STRING
KJNodes

The Save Image KJ node, based on ComfyUI's folder path management system, can convert input image tensors into common image formats (such as PNG) and write them to a specified directory.

The Save Image KJ node is an output node in ComfyUI used for saving images. Its core function is to save image data generated in the workflow to the local disk and supports appending descriptive text to the saved files.

Node Functionality

This node is based on ComfyUI's folder path management system and can convert input image tensors into common image formats (such as PNG) and write them to a specified directory. It supports using dynamic format strings in filenames, such as referencing attribute values from other nodes or the current date, to achieve flexible file naming. Additionally, the node provides an optional text input interface, allowing users to generate a separate text description file for the saved image.

Node Parameter Description - Save Image KJ

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
imagesIMAGEYes--The images to save.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
filename_prefixSTRINGYesComfyUI-The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.
output_folderSTRINGYesoutput-The folder to save the images to.
caption_file_extensionSTRINGNo.txt-The extension for the caption file.
captionSTRINGNo--string to save as .txt file

Output

Parameter NameData TypeDescription
filenameSTRINGDefines the prefix for the saved filename, supporting strings that include dynamic formatting.

Usage Scenarios

In a typical image generation workflow, you can connect the final image output from nodes such as KSampler or VAE Decode to the "images" input port of this node. Then, configure the output folder and filename prefix, and the node will automatically save the rendered results. If you need to record prompts or metadata for each generated image, you can connect these text information to the "caption" input port, and the node will save them as a text file with the same name.

Notes

Please note that the output_folder parameter can accept relative or absolute paths. When using a relative path, it will be resolved based on the output directory configured in ComfyUI. Ensure that the process running ComfyUI has write permissions to the target folder; otherwise, the save operation will fail.

The Save Image KJ node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…