floyo logobeta logo
Powered by
ThinkDiffusion
floyo logobeta logo
Powered by
ThinkDiffusion

ComfyUI Random Image Loader

1

Last updated
2025-05-11

A custom node for ComfyUI designed to randomly select and load an image from a specified directory, outputting it in the standard ComfyUI IMAGE format along with a MASK and the image's path as a STRING. This tool preserves the original dimensions of the images, providing flexibility in handling various image formats.

  • Supports multiple popular image formats including .jpg, .jpeg, .png, .gif, and .webp.
  • Maintains the original dimensions of the images, ensuring no loss of quality.
  • Allows for optional inclusion of subfolders in the image loading process.

Context

This tool serves as a custom node within ComfyUI, facilitating the random selection and loading of images from a designated folder. Its primary purpose is to enhance the workflow for users who require varied image inputs for their projects without manually selecting each one.

Key Features & Benefits

The ability to load images in various formats is crucial for users who work with diverse media types. By preserving the original dimensions of the images, this node ensures that the quality and aspect ratio remain intact, which is particularly important for applications requiring precise visual fidelity. The option to include subfolders expands the usability of the tool, allowing users to organize their images more flexibly.

Advanced Functionalities

This node can output not just the image itself but also an alpha channel mask if present, providing additional functionality for projects that may require image manipulation or masking techniques. The inclusion of the image path as a string can streamline processes that involve tracking or referencing the source of the images.

Practical Benefits

Integrating this random image loader into a ComfyUI workflow can significantly enhance efficiency by automating the image selection process. It reduces the time spent on manual image handling, allowing users to focus on other creative aspects of their projects. Furthermore, the consistent output format ensures compatibility with other nodes and processes within the ComfyUI environment.

Credits/Acknowledgments

This tool was developed by the user known as zveroboy, and it is available under the open-source license as indicated in the repository. Contributions from the community are acknowledged, and the project is structured to facilitate further enhancements and modifications.