Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-Get-Random-File > Load Random Video (Path) 🎲

ComfyUI Node: Load Random Video (Path) 🎲

Class Name

RandomVideoPathLoader

Category
🤖 CCTech/Files
Author
chriscoletech (Account age: 0days)
Extension
ComfyUI-Get-Random-File
Latest Updated
2026-11-03
Github Stars
0.0K

How to Install ComfyUI-Get-Random-File

Install this extension via the ComfyUI Manager by searching for ComfyUI-Get-Random-File
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Get-Random-File in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Load Random Video (Path) 🎲 Description

Randomly selects a video from a folder and its subfolders, optionally decoding frames and audio.

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 randomize to True when you want a different randomly selected source clip on successive runs. Set it to False while adjusting a workflow so the node keeps using its current selection unless that file disappears.
  • Set split to False when you only need filename or video, and leave images and audio unwired. This avoids decoding frames and audio while keeping fps and frame_count available.
  • 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 split at its default of True and 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_path does 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_path points 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 filename or video, try split set to False to 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 split to True when you need images or audio. 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.

Load Random Video (Path) 🎲 Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Get-Random-File
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.