{"record":{"id":"e779f0f7e5606eca","repo":"Comfy-Org/ComfyUI","slug":"no-video-files-found-in-sub-input-dir","errorCode":null,"errorMessage":"No video files found in {sub_input_dir}","messagePattern":"No video files found in (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_dataset.py","lineNumber":320,"sourceCode":"            outputs=[\n                io.Video.Output(\n                    display_name=\"videos\",\n                    is_output_list=True,\n                    tooltip=\"Lazy video references; frames are decoded only when needed downstream.\",\n                ),\n            ],\n        )\n\n    @classmethod\n    def execute(cls, folder):\n        sub_input_dir = secure_subfolder_path(folder_paths.get_input_directory(), folder)\n        video_files = sorted([\n            f for f in os.listdir(sub_input_dir)\n            if any(f.lower().endswith(ext) for ext in VALID_VIDEO_EXTENSIONS)\n        ])\n\n        if not video_files:\n            raise ValueError(f\"No video files found in {sub_input_dir}\")\n\n        videos = [InputImpl.VideoFromFile(os.path.join(sub_input_dir, f)) for f in video_files]\n        logging.info(f\"Loaded {len(videos)} lazy video references from {sub_input_dir}\")\n        return io.NodeOutput(videos)\n\n\nclass LoadVideoTextDataSetFromFolderNode(io.ComfyNode):\n    @classmethod\n    def define_schema(cls):\n        return io.Schema(\n            node_id=\"LoadVideoTextDataSetFromFolder\",\n            search_aliases=[\"load folder\", \"load from folder\", \"load dataset\", \"load videos\", \"import dataset\"],\n            display_name=\"Load Video-Text (from Folder)\",\n            category=\"video\",\n            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.\",\n            is_experimental=True,\n            inputs=[\n                io.Combo.Input(","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_dataset.py#L302-L338","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\nfolder contains: clip.m4v, clip2.mpeg\n# after\nfolder contains: clip.mp4, clip2.mp4  # remuxed to supported containers","handlingStrategy":"validation","validationCode":"VID_EXT = (\".mp4\", \".avi\", \".mov\", \".webm\", \".mkv\", \".flv\")\ndef folder_has_videos(d) -> bool:\n    return any(f.lower().endswith(VID_EXT) for f in os.listdir(d))","typeGuard":"def is_supported_video(fname: str) -> bool:\n    return fname.lower().endswith((\".mp4\", \".avi\", \".mov\", \".webm\", \".mkv\", \".flv\"))","tryCatchPattern":null,"preventionTips":["Pre-check the folder for the six supported extensions.","Remux exotic containers (.m4v, .ts) to .mp4.","Point at the leaf folder containing the videos."],"tags":["dataset","video","file-extension","comfyui"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}