Preview to Load Image:
JDL_PreviewToLoad lets you preview generated images while saving a copy that can be selected by a LoadImage node. It creates temporary PNGs for the preview and places a separate PNG of the first image in ComfyUI’s input directory. This is useful when you want to inspect a batch and keep one image available for a later workflow. The input-directory copy can also preserve an image mask through its PNG transparency, so a compatible LoadImage node can recover the mask when it opens the file.
Preview to Load Image Input Parameters:
images
The images to preview and save. This required IMAGE input accepts a batch: every image in the batch gets a temporary preview PNG, but only the first image is copied to the input directory. The node converts image values to PNG pixel values, clipping anything outside the supported range. Connect an image-producing node here; an empty batch cannot be processed because the node accesses its first image. No minimum, maximum, or default value is specified in the node interface.
filename
The name used for the PNG copy in ComfyUI’s input directory. This required STRING input defaults to preview. For example, portrait_test saves the first image as portrait_test.png. The node uses only the final name component, removes surrounding whitespace and dots, and falls back to preview if nothing remains. It adds .png itself, so enter a name without an extension to avoid a name such as portrait.png.png. Saving another image under the same name replaces the existing input-directory file. No minimum or maximum length is specified in the node interface.
mask
An optional MASK input for the input-directory copy of the first image. When connected, the node uses the first mask in a mask batch, converts it into PNG transparency, and resizes it to match the image if necessary. This is intended to let a LoadImage node recover the mask from that PNG. The mask is not applied to the temporary preview PNGs. Leave it disconnected when you only need the image. No default, minimum, or maximum value is specified in the node interface.
Preview to Load Image Output Parameters:
There are no output sockets. This is an output node: it displays temporary image previews and saves the first image to the input directory, but it does not provide an IMAGE or MASK connection for another node. Its UI result includes the preview file information and the saved input filename; these are display information, not additional output sockets.
Preview to Load Image Usage Tips:
- Connect a batch to preview every image, then look for the first image under your chosen filename in ComfyUI’s input directory. Only that first image is saved there for LoadImage.
- Use a distinctive filename for each image you want to keep. Reusing a name replaces the previous input-directory PNG.
- Enter a simple base name such as
concept_v2rather than a path or a name ending in.png. The node chooses the input directory and adds the extension. - Connect a mask when you need the saved PNG to carry it into LoadImage. Check the loaded mask afterward, especially if the original mask and image have different dimensions.
- Leave the mask disconnected when it is not needed. For a batch with multiple masks, note that only the first mask is used for the saved input-directory image.
Preview to Load Image Common Errors and Solutions:
IndexError: index 0 is out of bounds
- Explanation: The node needs a first image to create the saved input-directory PNG. An empty image batch can trigger an index error; the exact wording depends on where processing stops.
- Solution: Make sure the connected image-producing node supplies at least one image before running the workflow.
FileNotFoundError or PermissionError while saving a PNG
- Explanation: The node writes both temporary preview files and a PNG in ComfyUI’s input directory. A missing or unwritable destination can prevent either save.
- Solution: Check that ComfyUI’s temporary and input directories exist, have free space, and are writable by the process running ComfyUI. If necessary, ask whoever manages the installation to correct its directory permissions.
The expected file is not shown in LoadImage
- Explanation: Only the first image is saved to the input directory. The other batch images are temporary previews, not additional LoadImage files. The saved name also has
.pngappended automatically. - Solution: Look for the first image under the resulting PNG name, such as
concept_v2.png, and refresh LoadImage’s file list if needed.
The saved image replaced an earlier image
- Explanation: The input-directory copy uses the chosen filename without adding a unique counter. Running the node again with the same name writes to the same path.
- Solution: Use a new filename for each version you want to retain, or move an earlier PNG elsewhere before rerunning.
The saved filename ends in .png.png
- Explanation: The node always adds
.pngto the supplied filename, even when that filename already includes the extension. - Solution: Enter the base name only, such as
portraitinstead ofportrait.png.
The loaded mask does not match the expected image
- Explanation: The saved PNG contains the first image and, when supplied, the first mask. If their dimensions differ, the node resizes the mask to fit. Temporary preview files do not receive that mask.
- Solution: Check that the intended image and mask are first in their respective batches, and make their dimensions match before connecting them when precise mask placement matters. Load the input-directory PNG, not a temporary preview PNG, to retrieve its embedded mask.
