Nodes/ComfyUI Level Pixel/Get Iterator Data From Videos [LP]
ComfyUI Node

Get Iterator Data From Videos [LP]

Get Iterator Data From Videos [LP] — ComfyUI Node Guide

By LevelPixel·Created 2 years ago·Updated 6 months ago· 31
Get Iterator Data From Videos [LP]
    • iterator_data
    • video_count
    • frame_count
    directory_path
    patterns*.mp4|*.avi|*.mov|*.mkv
    rescan_each_queuetrue

    Same job as GetIteratorDataImageFolders, just pointed at video files instead of image folders. It scans a directory, finds the clips, and builds the manifest that lets the rest of LevelPixel's iterator nodes step through them one at a time as you re-queue the workflow.

    What it's for

    ComfyUI doesn't ship a native "loop over every video in this folder" primitive, so this is part of the same manual-loop scaffolding as Iterator, GetIteratorDataImageFolders, and ImageDataIterator: this node does the discovery pass, another node reads a position out of what it found, and you drive the whole thing by requeuing the prompt with an incrementing index. If you're batch-processing a folder of source clips - extracting frames, running a per-video pass, whatever - this is the "here's what's in there" step.

    It's worth being upfront: this node hands you counts and a manifest, not decoded frames. Actually pulling frame data out of a video for ComfyUI to work with is a separate step elsewhere in your graph (typically a video-loading node from this pack or another). This node's contribution is purely "which files, and how many frames total."

    Inputs and outputs

    • directory_path (STRING) - root folder to scan for video files.
    • patterns (STRING, default *.mp4|*.avi|*.mov|*.mkv) - pipe-separated extensions to match. Trim it down if you only care about one format, or add more if your source footage is mixed.
    • rescan_each_queue (BOOLEAN, default true) - rescans the directory on every queue run. Turn it off once your file list is stable to skip the repeated filesystem walk; leave it on while you're actively adding or removing clips.

    Outputs: iterator_data (the pack's custom ITERATOR_DATA type, meant for ImageDataIterator downstream), video_count (INT - how many clips matched), frame_count (INT - total frames across all matched clips, useful if your loop bound needs to be per-frame rather than per-file).

    Installing it

    Through ComfyUI Manager: search "ComfyUI-LevelPixel" and install - it shows up under the "Level Pixel" listing. Manual install: cd ComfyUI/custom_nodes && git clone https://github.com/LevelPixel/ComfyUI-LevelPixel.git, restart. This particular node is plain filesystem scanning, no models to fetch, but note that video decoding elsewhere in your ComfyUI setup (if you're pulling actual frames out of these files downstream) usually depends on ffmpeg being available on the system - that's a ComfyUI-wide dependency, not something this specific node installs for you.

    Common issues

    Path resolution is the number one trip-up, same as with the image-folder version: the path needs to be reachable from wherever ComfyUI's process is actually running, which is a different filesystem than your desktop if you're on a remote server, Docker, or any managed compute setup. Verify the path from inside that environment before assuming the node is broken.

    patterns is pipe-separated (|), not comma-separated - a common first mistake is writing *.mp4,*.mov and getting zero matches back, silently, with no error to point you at the typo.

    frame_count depends on the node being able to actually read each video's metadata to count frames, which means a corrupted or partially-downloaded video file in your folder can quietly throw off the total, or fail the scan outright depending on how brittle the file is. If your counts look off, it's worth spot-checking that every file in the folder actually opens cleanly in a normal video player first - that rules out a bad file before you go hunting for a node problem that isn't there.

    CategoryLevelPixel/Iterators

    Inputs (3)

    NameTypeDefaultDescription
    directory_pathSTRING
    patternsSTRING*.mp4|*.avi|*.mov|*.mkv
    rescan_each_queueBOOLEANtrue

    Outputs (3)

    NameTypeDescription
    iterator_dataITERATOR_DATA
    video_countINT
    frame_countINT