Nodes/ComfyUI-GPT4V-Image-Captioner/LoadPathImagesPreview
ComfyUI Node

LoadPathImagesPreview

Preview an entire folder in one run

By 438443467·Created 2 years ago·Updated about a year ago· 27
LoadPathImagesPreview
      path
      pattern*

      A "browse this folder" button for ComfyUI. LoadPathImagesPreview takes a path and a file pattern, loads every matching image, and writes them all into ComfyUI's output directory as previews in a single run. No image inputs, no wiring images through the graph - it's a one-shot utility for eyeballing a folder full of generated or scraped images, which is exactly the situation you're in when you've just dumped a batch of training candidates on disk.

      How it works

      It subclasses ComfyUI's built-in PreviewImage node, so it reuses the standard preview-save machinery. On execution it globs the path with the pattern (recursively, sorted), loads each matching image with EXIF orientation applied, converts to tensors, and passes them all to the preview saver under a sanmin.preview. filename prefix. Because it's an output node with no outputs, the only visible result is a stack of saved preview files in your output folder - which ComfyUI's image browser will happily show you.

      Inputs

      • path - the folder to scan (absolute path).
      • pattern - the glob, default *. Use *.png to limit to PNGs, or *.jpg for JPEGs.

      There are no outputs and nothing else to configure. If no images match, it raises a ValueError telling you nothing was found in the path - the error is the feature, it beats silently showing you nothing.

      Why you'd bother

      When you're captioning or sorting a dataset, the images live outside ComfyUI's own input folder. You could load them one at a time with a loader node and a preview node, but for a quick visual sweep this does the whole folder at once and leaves you with thumbnails you can page through. It's also handy as a "did my pipeline write files correctly" check: point it at your save folder after a batch run and confirm what landed. It's a niche tool, honestly - once you have the batch loader plus a preview, this is redundant - but it's the only node in the pack with zero plumbing.

      The usual caveat

      Like every "Sanmi Simple Node" here, this one was removed from the repo in the April 2025 rewrite that left the pack with only the GPT4V captioner. A fresh install won't show it in your node list; the code lives in the old Load_Image_Batch.py in the repo's git history. If all you want is to look at a folder, ComfyUI's own folder-watch features or a simple file browser do the same job with zero install.

      Install

      cd ComfyUI/custom_nodes
      git clone https://github.com/438443467/ComfyUI-GPT4V-Image-Captioner
      

      Restart ComfyUI. No models, no dependencies beyond what ComfyUI already has.

      CategorySanmi Simple Nodes/Simple NODE

      Inputs (2)

      NameTypeDefaultDescription
      pathSTRING
      patternSTRING*

      Outputs (0)

      No outputs