Comfy-Org/ComfyUI · error · ValueError
No video files found in {sub_input_dir}
Error message
No video files found in {sub_input_dir} What it means
LoadVideoDataSetFromFolderNode.execute lists the resolved input subfolder, keeps files whose lowercase extension is in VALID_VIDEO_EXTENSIONS (.mp4/.avi/.mov/.webm/.mkv/.flv), and raises if that filtered list is empty. Note the folder itself must already pass secure_subfolder_path, so this error means the folder exists (or at least is listable) but contains no recognized videos.
Source
Thrown at comfy_extras/nodes_dataset.py:320
outputs=[
io.Video.Output(
display_name="videos",
is_output_list=True,
tooltip="Lazy video references; frames are decoded only when needed downstream.",
),
],
)
@classmethod
def execute(cls, folder):
sub_input_dir = secure_subfolder_path(folder_paths.get_input_directory(), folder)
video_files = sorted([
f for f in os.listdir(sub_input_dir)
if any(f.lower().endswith(ext) for ext in VALID_VIDEO_EXTENSIONS)
])
if not video_files:
raise ValueError(f"No video files found in {sub_input_dir}")
videos = [InputImpl.VideoFromFile(os.path.join(sub_input_dir, f)) for f in video_files]
logging.info(f"Loaded {len(videos)} lazy video references from {sub_input_dir}")
return io.NodeOutput(videos)
class LoadVideoTextDataSetFromFolderNode(io.ComfyNode):
@classmethod
def define_schema(cls):
return io.Schema(
node_id="LoadVideoTextDataSetFromFolder",
search_aliases=["load folder", "load from folder", "load dataset", "load videos", "import dataset"],
display_name="Load Video-Text (from Folder)",
category="video",
description="Load a dataset of pairs of videos and text captions from a specified folder and return them as a list. Supported formats: MP4, AVI, MOV, WEBM, MKV, FLV.",
is_experimental=True,
inputs=[
io.Combo.Input(View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Verify the folder contains at least one file with a supported extension: .mp4, .avi, .mov, .webm, .mkv, or .flv.
- Re-encode or rename unsupported containers (e.g. .m4v -> remux to .mp4).
- Select the leaf folder that directly holds the videos, not a parent folder.
Example fix
# before folder contains: clip.m4v, clip2.mpeg # after folder contains: clip.mp4, clip2.mp4 # remuxed to supported containers
Defensive patterns
Strategy: validation
Validate before calling
VID_EXT = (".mp4", ".avi", ".mov", ".webm", ".mkv", ".flv")
def folder_has_videos(d) -> bool:
return any(f.lower().endswith(VID_EXT) for f in os.listdir(d)) Type guard
def is_supported_video(fname: str) -> bool:
return fname.lower().endswith((".mp4", ".avi", ".mov", ".webm", ".mkv", ".flv")) Prevention
- Pre-check the folder for the six supported extensions.
- Remux exotic containers (.m4v, .ts) to .mp4.
- Point at the leaf folder containing the videos.
When it happens
Trigger: Pointing `folder` at an input subfolder containing only images, .txt files, .mp4 with uppercase extension is fine (lowercased) but exotic containers like .m4v or .ts are not in the list and yield an empty result; also an empty folder.
Common situations: Wrong extension vocabulary — users with .m4v/.mpeg/.wmv files; folder selected from the wrong level (parent containing subfolders rather than the videos themselves); files still uploading/syncing.
Related errors
- Provide either a background image or a background video, not
- Reference video {index} is too small: {w}x{h} = {pixels:,} t
- Reference video {index} is too large: {w}x{h} = {pixels:,} t
- Up to {SEED_MAX_VIDEOS} videos are supported per request.
- No valid images found in input
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/e779f0f7e5606eca.
Report an issue: GitHub.