Extensions/Image Batch Loader by Steve Lasmin
ComfyUI Extension

Image Batch Loader by Steve Lasmin

A ComfyUI custom node that loads images sequentially from a folder, cycling back to the first image when reaching the end. Outputs the loaded image along with its width and height as strings.

By Eklipsis·Created 2 months ago·Updated a day ago· 0
Eklipsis/comfyui-image-batch-loader-steve-lasmin
Nodes
On cloudLocal install
Stars0
Updateda day ago
Readme

Image Batch Loader by Steve Lasmin

A ComfyUI custom node that loads images sequentially from a folder, cycling back to the first image when the end is reached. Outputs the loaded image along with its width and height as strings.


Features

  • Sequential loading — Each queue item loads the next image in the folder.
  • Auto-cycling — When the end of the folder is reached, it wraps back to the first image.
  • String dimensions — Outputs width and height as STRING types, perfect for wiring into text nodes, prompt builders, or conditioning workflows.
  • Deduplication-safe — Handles ComfyUI's multiple internal calls per queue item without skipping images or desyncing outputs.
  • Reset counter — Optional toggle to restart from the first image on demand.

Installation

Method 1: ComfyUI Manager (Comfy Registry)

  1. Open ComfyUI Manager → Click Install via Comfy Registry.
  2. Search for "Image Batch Loader by Steve Lasmin".
  3. Click Install and restart ComfyUI.

Method 2: Manual

  1. Download or clone this repository into ComfyUI/custom_nodes/:
    cd ComfyUI/custom_nodes
    git clone https://github.com/Eklipsis/comfyui-image-batch-loader-steve-lasmin.git
    
  2. Restart ComfyUI.

Usage

  1. Add the "Image Batch Loader by Steve Lasmin" node to your workflow (found under Steve Lasmin → image).
  2. Set folder_path to the absolute path of your image folder (e.g., C:\\Images\\batch01).
  3. Connect the image output to your image processing pipeline.
  4. Connect width and height to any nodes that accept STRING inputs.
  5. Click Queue Prompt. Each queue item will load the next image and output its dimensions.

Inputs

| Input | Type | Description | |-------|------|-------------| | folder_path | STRING | Absolute path to the folder containing images. Supports: PNG, JPG, JPEG, WEBP, BMP, GIF, TIFF, TIF. | | reset_counter | BOOLEAN | When enabled, resets the internal counter to 0 so the next queue item starts from the first image again. |

Outputs

| Output | Type | Description | |--------|------|-------------| | image | IMAGE | The loaded image as a ComfyUI IMAGE tensor [B, H, W, C]. | | width | STRING | Width of the loaded image in pixels. | | height | STRING | Height of the loaded image in pixels. |


How It Works

ComfyUI may call a node's execution function multiple times per queue item (for validation, preview, etc.). This node uses an internal cache keyed by the prompt execution ID to ensure:

  • The counter only advances once per queue item.
  • The image, width, and height outputs are always perfectly matched to the same loaded file.

Credits

Created by Steve Lasmin


License

MIT License — see LICENSE for details.