Nodes/Batch Video Loader/πŸ”’ Batch Video Counter
ComfyUI Node

πŸ”’ Batch Video Counter

Count your numbered videos β€” and spot the gaps before the batch run

By skakjskj189212-techΒ·Created 4 months agoΒ·Updated 4 months agoΒ· 0
πŸ”’ Batch Video Counter
    • total_count
    • found_files_list
    β—„folder_pathβ–Ί

    It's the quiet half of the Batch Video Loader pack, and it answers the question you should ask before any batch job: how many videos are actually in this folder, and are any numbers missing? Batch Video Counter scans a folder, counts the numbered video files, and - the genuinely useful part - warns you about holes in the sequence.

    It exists because its sibling loader treats numbers as positions in skip_missing mode, precisely because real folders have holes. A render fails, a clip gets deleted, and suddenly you have 1.mp4, 2.mp4, 4.mp4. The counter is the sanity check that catches this before you kick off a run - the difference between discovering a gap mid-batch and discovering it in two seconds. Both nodes share the same convention, so it's worth repeating once: files must be named as pure numbers (1.mp4, 2.mp4) with a .mp4, .mov, .avi, .mkv or .webm extension. Anything else is invisible to the pack.

    One input, two outputs

    The only input is folder_path, a plain STRING field with no browse button - paste the absolute path. A notable design choice: point it at a folder that doesn't exist and it doesn't crash. You get total_count = 0 and a "Folder not found:" note in the string output instead. That's the opposite of the loader, which raises and lists what it couldn't find. Handy if you want the count wired into logic; mildly annoying if you actually wanted the error.

    The outputs:

    • total_count (INT) - how many numbered videos matched the scheme.
    • found_files_list (STRING) - the filenames, one per line, in numeric order. When numbers are missing inside the sequence, the node appends a line like ⚠️ Missing numbers: 2, 4.

    Two honest caveats about that gap warning. It only reports holes between the first and last file it finds - it can't flag that the sequence starts at 2.mp4 or stops short of 40.mp4, because it has no way to know what you intended. And found_files_list is a single STRING, not a list of files. Don't wire it into something that expects per-file iteration; that's what the loader is for.

    What you actually do with it

    Two workflows make sense. Wire total_count into the graph so your batch knows how many runs to expect - feed it to the loader's total_videos-style bookkeeping or a display node. Or just park the node in a corner of the graph as a quick "is this folder sane?" check before you queue 40 upscales and walk away. If it prints a gap warning you didn't know about, either fix the folder or switch the loader to skip_missing mode and let the batch sail over the holes. The console also logs [BatchVideoCounter] Found N videos. when it runs, which is a free way to confirm the scan happened without a display node.

    Install

    Same as the whole pack: zero dependencies, pure Python, no models to download. Either search "Batch Video Loader" in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/skakjskj189212-tech/comfyui-batch-video-loader
    

    Restart ComfyUI and it lives under Video β†’ Batch. No setup beyond that, and nothing to break later - there's no hidden requirement lurking in the install.

    It's a two-file utility from a no-name author (skakjskj189212-tech), so keep expectations in line: this is a folder inspector for one very specific naming scheme, not a video toolkit. But for that scheme - numbered clips waiting for a batch pass - it's the cheap insurance that keeps a 40-clip run from dying on clip seven.

    CategoryVideo/Batch

    Inputs (1)

    NameTypeDefaultDescription
    folder_pathSTRINGβ€”

    Outputs (2)

    NameTypeDescription
    total_countINTβ€”
    found_files_listSTRINGβ€”