Load Random Video (Path) 🎲:
RandomVideoPathLoader chooses a video file at random from a folder and its subfolders, then makes the selected video available to the rest of your workflow. You can use it to rotate through source clips across runs or hold one selection while you refine a workflow. It can also skip the more time-consuming step of decoding frames and audio when you only need to pass the video along. The node searches for files with supported video extensions; the provided source does not list those extensions.
Load Random Video (Path) 🎲 Input Parameters:
folder_path
The folder to search for videos, including its subfolders. Enter a directory path that your ComfyUI environment can access. The node removes surrounding spaces and double quotes from the entry and converts it to an absolute path before searching. This parameter is required. Its default is an empty string; no minimum or maximum length is specified. An invalid directory or a directory with no files matching the supported video extensions causes an error.
randomize
Controls whether the node makes a new random selection on each run. With True, it picks from the matching files each time. With False, it keeps returning the video previously selected by this node, provided that file still exists; if it no longer exists, the node picks another file. The options are True and False, and the default is True. No numeric minimum or maximum applies.
split
Controls whether the node decodes the selected video into separate frame and audio components. With True, it performs that decoding so you can use those components downstream. With False, it skips frame and audio decoding, which can be faster when you only need to pass along the video or identify the selected file; the video and filename remain available, while frame rate and frame count come from the container header. Leave frame and audio connections unused when this setting is off. The options are True and False, and the default is True. No numeric minimum or maximum applies.
Load Random Video (Path) 🎲 Output Parameters:
images
An IMAGE output containing the decoded video frames when split is on. Connect it when your workflow needs to process or inspect frames as images. When split is off, frame decoding is bypassed, so do not rely on this output for usable frames.
filename
A STRING containing the selected file’s path, rather than just its basename. You can use it to identify which clip was chosen or pass its location to another compatible node. It remains available when split is off.
video
A VIDEO output for the selected video. Use it with downstream nodes that accept a video directly. It remains available when split is off, so you do not need to decode frames merely to pass the video along.
audio
An AUDIO output for audio obtained when the video is split into components. A selected video may have no audio. When split is off, audio decoding is bypassed, so leave this output unwired if your workflow needs an audio component.
fps
A FLOAT representing the selected video’s frame rate in frames per second. This tells you how quickly its frames play back. It is also provided when split is off, using information from the video container header.
frame_count
An INT representing the selected video’s number of frames. It can help you understand the clip’s length in frames or configure a later step that needs a frame count. It is also provided when split is off, using information from the video container header.
Load Random Video (Path) 🎲 Usage Tips:
- Set
randomizetoTruewhen you want a different randomly selected source clip on successive runs. Set it toFalsewhile adjusting a workflow so the node keeps using its current selection unless that file disappears. - Set
splittoFalsewhen you only needfilenameorvideo, and leaveimagesandaudiounwired. This avoids decoding frames and audio while keepingfpsandframe_countavailable. - Keep the videos you want to choose from in the specified folder or its subfolders. Check the path from the environment running ComfyUI, especially when your files are on a different machine or mounted drive.
- If you need to work with individual frames or audio, leave
splitat its default ofTrueand connect the relevant outputs.
Load Random Video (Path) 🎲 Common Errors and Solutions:
'<directory_path>' is not a valid directory path.
- Explanation: The path entered in
folder_pathdoes not point to a directory accessible to the environment running the node. An empty path can also lead to an unintended location after it is converted to an absolute path. - Solution: Enter the path to an existing folder and confirm that ComfyUI can access it. Check the spelling, drive or mount location, and whether you supplied a file path instead of a folder path.
No <extension>-type files found in directory: <directory_path>
- Explanation: The folder search found no files matching the video extensions configured for this node, including in its subfolders. The exact extension named in the message depends on the extension list, which is not shown in the provided source.
- Solution: Confirm that the folder contains a video with an extension supported by this installation, and that
folder_pathpoints to the intended folder. Check the file extensions if the folder contains videos but the error persists.
Video decoding or file-reading error
- Explanation: A file may be selected successfully but fail when the node attempts to load it. The provided source does not show the video-loading implementation, so it does not establish a specific error message or every possible cause.
- Solution: Check that the selected file exists and opens normally in a video player. If your workflow only needs
filenameorvideo, trysplitset toFalseto skip frame and audio decoding; this does not guarantee that every file-reading problem can be bypassed.
Missing usable frames or audio with split set to False
- Explanation: This setting deliberately bypasses frame and audio decoding. It is not a directory-search error, but downstream nodes expecting those components may not receive usable data.
- Solution: Set
splittoTruewhen you needimagesoraudio. If you only need the selected path or video, leave those component outputs unwired.
No audio from a selected video
- Explanation: The node’s result allows for a video with no audio; its preview can indicate “no audio” when splitting is on. A silent or audio-free source cannot provide an audio component simply by enabling
split. - Solution: Check the selected video for an audio track. Use a video that contains audio if a downstream step requires it.
