Nodes/Klinter_nodes/Video From Folder - Klinter
ComfyUI Node

Video From Folder - Klinter

Seed-driven video picker for reproducible batches

By klinter007·Created 3 years ago·Updated 9 months ago· 19
Video From Folder - Klinter
    • frames
    • video_path
    • video_index
    • fps
    • duration
    • frame_count
    folder_path
    seed0
    seed_mode
    seed_offset0

    Folder Loader does this for images; Video From Folder - Klinter does it for videos, with a twist: instead of just loading every clip in a directory, it picks one video based on a seed. That seed-based selection is the whole point - it lets you iterate deterministically through a folder of videos, or hand-pick a clip with a number, without dragging files around.

    The inputs are folder_path, seed, seed_mode, and an optional seed_offset. The mode dropdown is where the design gets interesting. fixed picks a video deterministically from the seed - same seed, same clip, every run. random uses the seed to seed the random picker (reproducible-ish, one random draw per distinct seed). increment is the batch workhorse: every run advances to the next video in the folder, so you can queue a workflow repeatedly and have it chew through your whole folder one clip at a time. The source even forces an "always changed" fingerprint in increment mode so ComfyUI doesn't skip re-execution. seed_offset nudges the selection index for fine control when the base seed lands on a clip you don't want.

    The outputs are generous and mostly self-explanatory: frames (IMAGE), video_path (STRING), video_index (INT - which position in the sorted list got picked), fps, duration, and frame_count (both FLOAT/INT). Having the index and metadata alongside the frames is genuinely useful for logging which clip produced which output, especially in a batch run. It accepts the usual video extensions (mp4, mov, avi, mkv, webm, m4v) and sorts the list before picking, so the ordering is stable.

    The honest dependency note: reading video info uses a fallback chain of cv2 → imageio → ffmpeg, so it works with whatever's on your box, but a missing cv2 means it leans on the others and you lose the nicest path. Keep at least one of those available or the node can't probe the clip. And as with every "point at a folder" node in this pack, the path must be reachable from the ComfyUI server itself.

    Install is the pack standard: search "Klinter_nodes" in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/klinter007/klinter_nodes then restart. No requirements.txt - but if you want the primary cv2 path, have opencv-python in your ComfyUI environment.

    If you process folders of clips in batches and want reproducible, seed-driven selection, this is the node that turns "which video did I get" into a controllable variable.

    Categoryklinter

    Inputs (4)

    NameTypeDefaultDescription
    folder_pathSTRING
    seedINT00–18446744073709550000
    seed_modeCOMBO3 options: increment, random, fixed
    seed_offsetoptINT0

    Outputs (6)

    NameTypeDescription
    framesIMAGE
    video_pathSTRING
    video_indexINT
    fpsFLOAT
    durationFLOAT
    frame_countINT