Nodes/ComfyUI-LoadAnim-Adv/Load Images/Videos From Directory
ComfyUI Node

Load Images/Videos From Directory

Load a series of images from directory path. Supports loading frame data.

By SineSwiper·Created 6 months ago·Updated 6 months ago· 0
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)

    NameTypeDefaultDescription
    directorySTRINGAbsolute or relative path to the image directory.
    RGBABOOLEANfalseControls whether to include the Alpha channel in the 'image' output. The 'mask' output will always include this data.
    widthINT0Final width of images, after resizing. Zero means to keep the original width.
    heightINT0Final height of images, after resizing. Zero means to keep the original height.
    keep_aspect_ratioCOMBOWhat action to take, when the image doesn't match the expected aspect ratio.
    image_file_load_capINT0Maximum amount of image files (not frames) to load. Zero means no maximum.
    image_file_start_indexINT0Index (zero-based) to start loading files, based on the collected filenames from the directory search.
    frame_indexes_to_selectSTRING0: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_capINT0Maximum amount of total frames to load. Zero means no maximum.
    flatten_framesBOOLEANfalseControls whether to flatten the frames from multiple files into a single image set. This impacts all outputs except 'image_path'.
    include_subfoldersBOOLEANfalseControls whether to recursively search for files within subdirectories.
    valid_extensionsSTRINGjpg,jpeg,png,webp,gif,tgaComma-delimited list of file extensions to search for.
    sort_methodCOMBOControls how to sort the image filename list.

    Outputs (6)

    NameTypeDescription
    imageIMAGEThe image data, either as a single image or a set of frames.
    maskMASKAny transparency data found in the Alpha channel or transparent palette index.
    audioAUDIOThe audio from the video, if any.
    frame_countsINTTotal number of frames loaded from all images.
    fpsFLOATFrames-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_pathSTRINGFilenames of the loaded images.