Save Image With Prompt:
Save Image With Prompt saves generated images as PNG files in your ComfyUI output directory. It is designed to keep useful information about an image alongside the image itself: when metadata is enabled in ComfyUI, the saved PNG can contain your prompt text, caption, seed, and standard workflow information. This makes it easier to identify how an image was made when you return to it later. The node can save a batch of images in one run and reports the saved files to the ComfyUI interface.
Save Image With Prompt Input Parameters:
images
The image or batch of images to save. Connect an IMAGE output from an earlier node. The node saves each image as a separate PNG and uses the first image to determine the save path. There is no default image; you must supply one. No minimum or maximum batch size is specified in the provided interface, but the source expects at least one image.
filename_prefix
The beginning of each saved filename. The default is ComfyUI. Choose a descriptive prefix, such as portrait_study, to help you find related images in your output directory. The node replaces whitespace in the prefix with underscores and limits its length before saving; the numeric length limit is not shown in the provided source. No minimum value or selectable options are specified.
positive_prompt
Text describing what you wanted to appear in the image. The default is an empty string, and no minimum or maximum text length is specified. When you provide a non-empty value and ComfyUI metadata is enabled, the node writes it to the PNG under positive_prompt. This field documents the image; it does not change the image being saved.
additional_prompt
A second prompt field for supplementary text you want to retain with the image. The default is an empty string, and no minimum or maximum text length is specified. A non-empty value is saved as PNG metadata under additional_prompt when metadata is enabled. Like the other text fields, it records information rather than altering the image.
negative_prompt
Text describing elements you intended to avoid. The default is an empty string, and no minimum or maximum text length is specified. If you enter a value, the node stores it under negative_prompt when metadata is enabled. Enter the negative prompt you want associated with the saved image; this field does not apply a negative prompt during generation.
caption
A short description or label for the finished image. The default is an empty string, and no minimum or maximum text length is specified. A non-empty caption is stored under caption when metadata is enabled. It can help you distinguish images whose prompts are similar without changing their appearance.
seed
The seed you want recorded with the image. This is a STRING field, not a numeric seed control: its default is an empty string, and the source specifies no numeric range or text-length limit. A non-empty value is stored under seed when metadata is enabled. Entering a seed here documents it but does not set the seed used by the image-generation nodes.
numbers
Controls whether the node adds an incrementing number to saved filenames. The default is True; the available options are Include Numbers (True) and No Numbers (False). With numbers enabled, filenames end with a five-digit counter followed by an underscore before .png. With numbers disabled, that counter is omitted, so saving again with the same resulting filename may overwrite an existing PNG. This setting affects filenames, not image content or metadata.
Save Image With Prompt Output Parameters:
This node has no output sockets or output parameters. It saves PNG files to the ComfyUI output directory and returns information about those files for display in the ComfyUI interface; you cannot connect a downstream node to an image output from this node.
Save Image With Prompt Usage Tips:
- Keep
numbersenabled when saving several images or rerunning a workflow with the same prefix. The counter gives each saved file a distinct name. - Use
No Numbersonly when you deliberately want a stable filename, and check for an existing file first: a later save can replace a PNG with the same name. - Put the seed actually used for generation into
seedif you want the saved metadata to be a useful record. This node does not retrieve or apply that seed for you. - Fill in only the text fields you need. Empty prompt, caption, and seed fields are omitted from the PNG metadata.
- Keep ComfyUI metadata enabled if you rely on the embedded information. When metadata is disabled, the node still saves the PNG but does not write these text fields or the standard prompt information.
- For batch saves, use a prefix that identifies the project or run. If the resolved filename contains
%batch_num%, the node replaces that token with each image’s zero-based position in the batch.
Save Image With Prompt Common Errors and Solutions:
IndexError: index 0 is out of bounds
- Explanation: The node reads the first item in
imagesto prepare the save path. An empty image batch can therefore fail before any PNG is written. The exact error wording may vary. - Solution: Check that the upstream node produced at least one image and that its IMAGE output is connected to
images.
AttributeError: object has no attribute 'cpu'
- Explanation: Each image is expected to be a ComfyUI image tensor. This kind of error can occur if an incompatible value reaches
images; the exact wording depends on that value. - Solution: Connect a valid IMAGE output rather than text, a filename, or another data type.
TypeError: Cannot handle this data type
- Explanation: The image array passed to Pillow may have an unsupported shape or channel arrangement. The precise message can vary.
- Solution: Check the upstream image-processing nodes and supply a standard ComfyUI IMAGE value. If a custom node produces the image, test with a conventional image source to isolate the problem.
PermissionError: [Errno 13] Permission denied
- Explanation: The PNG save operation cannot write to the selected output location. Permissions or a conflicting filesystem item may be responsible.
- Solution: Make sure ComfyUI can write to its output directory and that the destination is available.
OSError: No space left on device
- Explanation: The storage device holding the output directory does not have enough free space for the PNG.
- Solution: Free space on that device, then run the save again.
Expected metadata is missing from the PNG
- Explanation: This may occur without an error message. The node writes metadata only when ComfyUI metadata is enabled, and it skips individual text fields whose values are empty.
- Solution: Check ComfyUI’s metadata setting and enter values in the fields you want embedded before saving again.
A previous PNG was replaced
- Explanation: This may also occur without an error message. With
numbersset toFalse, the node omits its counter, so a later save can use the same filename. - Solution: Turn on
Include Numbersor choose a differentfilename_prefixfor each run.
