ComfyUI Node
Load Images/Videos From Directory
Load a series of images from directory path. Supports loading frame data.
Load Images/Videos From Directory
- image
- mask
- audio
- frame_counts
- fps
- image_path
◄directory—►
◄RGBAfalse►
◄width0►
◄height0►
◄keep_aspect_ratio▾►
◄image_file_load_cap0►
◄image_file_start_index0►
◄frame_indexes_to_select0:►
◄total_frame_load_cap0►
◄flatten_framesfalse►
◄include_subfoldersfalse►
◄valid_extensionsjpg,jpeg,png,webp,gif,tga►
◄sort_method▾►
CategoryLoadAnimAdv/Loaders
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| directory | STRING | Absolute or relative path to the image directory. | |
| RGBA | BOOLEAN | false | Controls whether to include the Alpha channel in the 'image' output. The 'mask' output will always include this data. |
| width | INT | 0 | Final width of images, after resizing. Zero means to keep the original width. |
| height | INT | 0 | Final height of images, after resizing. Zero means to keep the original height. |
| keep_aspect_ratio | COMBO | What action to take, when the image doesn't match the expected aspect ratio. | |
| image_file_load_cap | INT | 0 | Maximum amount of image files (not frames) to load. Zero means no maximum. |
| image_file_start_index | INT | 0 | Index (zero-based) to start loading files, based on the collected filenames from the directory search. |
| frame_indexes_to_select | STRING | 0: | Frame indexes (zero-based) to select from each image file. Supports ':' for range selection (including ':#', '#:' formats), '::#' & '#::#' & '#:#:#' formats for step selection, ',' for multiple entries, and negative numbers for selecting from the end. Note that audio is not sliced based on frame selection, which may cause audio desyncs. (This may be fixed in the future.) |
| total_frame_load_cap | INT | 0 | Maximum amount of total frames to load. Zero means no maximum. |
| flatten_frames | BOOLEAN | false | Controls whether to flatten the frames from multiple files into a single image set. This impacts all outputs except 'image_path'. |
| include_subfolders | BOOLEAN | false | Controls whether to recursively search for files within subdirectories. |
| valid_extensions | STRING | jpg,jpeg,png,webp,gif,tga | Comma-delimited list of file extensions to search for. |
| sort_method | COMBO | Controls how to sort the image filename list. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The image data, either as a single image or a set of frames. |
| mask | MASK | Any transparency data found in the Alpha channel or transparent palette index. |
| audio | AUDIO | The audio from the video, if any. |
| frame_counts | INT | Total number of frames loaded from all images. |
| fps | FLOAT | Frames-per-second, as reported from all of the image metadata. This may be zero, if the data could not be found, or the image doesn't animate. If flattened, multiple animations with different FPSs will be averaged and may have unpredictable results. |
| image_path | STRING | Filenames of the loaded images. |