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.
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
widthandheightas 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)
- Open ComfyUI Manager → Click Install via Comfy Registry.
- Search for "Image Batch Loader by Steve Lasmin".
- Click Install and restart ComfyUI.
Method 2: Manual
- 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 - Restart ComfyUI.
Usage
- Add the "Image Batch Loader by Steve Lasmin" node to your workflow (found under
Steve Lasmin → image). - Set
folder_pathto the absolute path of your image folder (e.g.,C:\\Images\\batch01). - Connect the
imageoutput to your image processing pipeline. - Connect
widthandheightto any nodes that accept STRING inputs. - 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, andheightoutputs are always perfectly matched to the same loaded file.
Credits
Created by Steve Lasmin
- Support: https://boosty.to/stevelasmin
- Contact: [email protected]
License
MIT License — see LICENSE for details.