Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-JSON-Dynamic > Preview to Load Image

ComfyUI Node: Preview to Load Image

Class Name

JDL_PreviewToLoad

Category
JSON Dynamic/image
Author
ethanfel (Account age: 0days)
Extension
ComfyUI-JSON-Dynamic
Latest Updated
2026-11-03
Github Stars
0.0K

How to Install ComfyUI-JSON-Dynamic

Install this extension via the ComfyUI Manager by searching for ComfyUI-JSON-Dynamic
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-JSON-Dynamic in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Preview to Load Image Description

Previews image batches and saves the first image as a PNG for LoadImage, with an optional mask.

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_v2 rather 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 .png appended 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 .png to the supplied filename, even when that filename already includes the extension.
  • Solution: Enter the base name only, such as portrait instead of portrait.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.

Preview to Load Image Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-JSON-Dynamic
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.