ComfyUI Extension: ComfyUI Random Image Loader
A custom node for ComfyUI that loads a random image from a specified folder and outputs it in the standard ComfyUI IMAGE format, along with a MASK and the image path as STRING. Images are loaded in their original dimensions.
Custom Nodes (0)
README
ComfyUI Random Image Loader
A custom node for ComfyUI that loads a random image from a specified folder and outputs it in the standard ComfyUI IMAGE
format, along with a MASK
and the image path as STRING
. Images are loaded in their original dimensions.
Features
- Loads images in popular formats:
.jpg
,.jpeg
,.png
,.gif
,.webp
- Preserves original image dimensions
- Optional subfolder inclusion
- Outputs:
image
: Tensor of the loaded imagemask
: Alpha channel mask (if present)image_path
: Path to the selected image
Installation
- Clone this repository into your ComfyUI
custom_nodes
folder:git clone https://github.com/yourusername/comfyui-random-image-loader.git cd comfyui-random-image-loader
- Install dependencies:
pip install -r requirements.txt
- Restart ComfyUI
Usage
Add the "Load Random Image" node from the zverovboy category in ComfyUI. Set the folder path to your image directory. Optionally enable include_subfolders.
Project Structure
init.py: Required for ComfyUI to recognize the custom node module. nodes.py: Contains the node implementation. requirements.txt: Lists dependencies.
Requirements
Python 3.8+ PyTorch Pillow NumPy