Visit ComfyUI Online for ready-to-use ComfyUI environment
Efficiently load images based on seed number for deterministic selection from specified directory.
The Load Image Based on Number node is designed to help you efficiently load an image from a specified directory based on a given seed number. This node is particularly useful when you have a large collection of images and want to select one deterministically using a seed value. The node ensures that even if the seed number is very large, it will wrap around the list of available images using the modulo operation, providing a seamless and predictable way to access images. This functionality is beneficial for tasks that require consistent image selection based on a numerical input, such as generating reproducible results in AI art projects.
This parameter specifies the directory where the images are stored. It should be a string representing the path to the directory. The node will search this directory for image files with extensions such as .png, .jpg, .jpeg, .webp, .bmp, and .gif. The directory must exist, otherwise, an error will be raised. This parameter is crucial as it defines the source from which the images will be loaded.
The seed parameter is an integer that determines which image to load from the directory. The seed can be any non-negative integer, and the node uses the modulo operation to ensure that the seed value wraps around the list of available images if it exceeds the number of images in the directory. This allows for consistent and repeatable image selection based on the seed value. The default value is 0, with a minimum of 0 and a maximum of 0xffffffffffffffff.
This output parameter is the loaded image in tensor format. The image is selected based on the seed value and is converted to a tensor for further processing within the AI art pipeline. This format is essential for compatibility with other nodes and operations that may follow.
The filename output parameter provides the name of the image file that was loaded. This is useful for tracking and referencing the specific image used, especially in scenarios where reproducibility and documentation are important.
<image_directory>
does not exist© Copyright 2024 RunComfy. All Rights Reserved.