Nodes/ComfyUI/Load Video-Text (from Folder)
ComfyUI Node Runs on cloud

Load Video-Text (from Folder)

Videos and their captions, loaded as a pair

By Comfy-Org·Created 4 years ago·Updated about 5 hours ago· 128,055
Load Video-Text (from Folder)
    • videos
    • texts
    folder

    Load Video-Text (from Folder) is the caption-paired twin of Load Video (from Folder). Same idea, one addition that changes what it's for: it also reads a .txt caption sitting next to every clip, and hands you both lists out the door - videos[0] pairs with texts[0], and so on down the line.

    That parallel structure is exactly the shape a text-conditioned video trainer wants. If you're building a training dataset for image-to-video or text-to-video LoRA work, you don't just need clips - you need clip plus caption pairs, and this node turns a folder of clip_001.mp4 + clip_001.txt pairs into a dataset in one step. Its plain sibling is the version you reach for when captions don't matter. Both are new core nodes from mid-2026, still flagged experimental.

    How it works

    Each video looks for a .txt file with the same basename, right next to it - clip_001.mp4 pairs with clip_001.txt. The caption is read as UTF-8 and stripped of surrounding whitespace. Missing .txt? You get an empty string, not an error.

    The interesting bit is folder convention support. It understands the kohya-ss/sd-scripts layout: a subfolder named 5_car automatically repeats each video inside it five times in the dataset. That's how trainers upweight a concept - five copies of a rare class, one of a common one. Note this is the only recursion it does; the plain video loader reads a flat folder and stops.

    Inputs and outputs

    • folder - the only input. Combo dropdown of subfolders under ComfyUI/input/, same as its sibling. Drop your clips and captions in input/<folder>/.
    • videos - VIDEO list.
    • texts - STRING list, one caption per video.

    Both lists are index-aligned by construction, and keeping them aligned is the one thing you must not fumble. If you slice, shuffle, or reorder one list, you have to do the same to the other or your captions quietly wander onto the wrong clips.

    Gotchas

    • Empty captions are the silent trap. A missing .txt becomes '', and an empty-prompt sample degrades a LoRA slowly instead of failing loudly. Sweep your folder for orphans before you spend hours training.
    • Matching is by exact basename. clip_001.MP4 won't pair with clip_001.txt - the extension filter is case-insensitive but the caption lookup matches the name as-is, so keep casing and spelling consistent.
    • Repeat prefixes only work in this node. If you use the plain loader, 5_car is just a folder name it ignores.
    Categoryvideo

    Inputs (1)

    NameTypeDefaultDescription
    folderCOMBOThe folder containing video files and .txt captions.

    Outputs (2)

    NameTypeDescription
    videosVIDEOLazy video references; frames are decoded only when needed downstream.
    textsSTRINGList of text captions.