> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# LoadVideoTextDataSetFromFolder - ComfyUI Built-in Node Documentation

> This node loads video files and their matching text captions from a folder inside the ComfyUI input directory, and returns them as two lists: videos and captions.

This node loads video files and their matching text captions from a folder inside the ComfyUI input directory, and returns them as two lists: videos and captions. The video entries are lazy references, so frames are decoded only when a downstream node needs them. Supported formats are MP4, AVI, MOV, WEBM, MKV, and FLV, and nested folders with a repeat-count prefix (for example `5_classname/`, as used by tools like kohya-ss/sd-scripts) are also supported.

## Inputs

| Parameter | Description | Data Type | Required | Range |
| - | - | - | - | - |
| `folder` | The folder containing video files and .txt captions. | COMBO | Yes | Dynamically lists all subfolders inside the ComfyUI input directory |

The selected folder must be a subfolder of the ComfyUI input directory; a folder name that resolves outside of that directory raises an error. If the selected folder contains no files with a supported video extension (MP4, AVI, MOV, WEBM, MKV, FLV), the node raises an error. For nested folders whose name starts with a number followed by an underscore (for example `5_classname`), each video inside that folder is included in the dataset the number of times given by that prefix. Each video's caption is read from a `.txt` file with the same base name; if no matching `.txt` file exists, the caption is an empty string.

## Outputs

| Output Name | Description | Data Type |
| - | - | - |
| `videos` | Lazy video references; frames are decoded only when needed downstream. One entry per video file found in the folder. | VIDEO (list) |
| `texts` | List of text captions. One caption per video; if a video has no matching `.txt` file, its caption is an empty string. | STRING (list) |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/LoadVideoTextDataSetFromFolder/en.md)

***

**Source fingerprint (SHA-256):** `21ed21bc3189e96be5c7f0415c65e8749d6591cf19bddf4350a3b0af48b92841`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.