Nodes/komojini-comfyui-nodes/🎥Ultimate Video Loader🎥
ComfyUI Node

🎥Ultimate Video Loader🎥

Ultimate Video Loader — one node, four ways to get video frames into ComfyUI

By komojini·Created 3 years ago·Updated 2 years ago· 77
🎥Ultimate Video Loader🎥
    • images
    • frame_count
    • fps
    • width
    • height
    ◄source▾►
    â—„youtube_urlyoutube/url/hereâ–º
    â—„videoX://insert/path/here.mp4â–º
    ◄upload▾►
    â—„start_sec0.0â–º
    â—„end_sec0.0â–º
    â—„max_fps-1â–º
    ◄force_size▾►
    â—„frame_load_cap50â–º
    â—„width512â–º
    â—„height512â–º
    â—„frame_count1â–º
    â—„fps10â–º

    🎥Ultimate Video Loader🎥 is the flagship of the komojini pack, and it's easy to see why: it's the "fuck it, just get me the frames" node for video-generation workflows. Instead of juggling a video loader per source, you pick one of four sources - a file on disk, a file you upload through the browser, a YouTube URL, or a blank canvas - and it hands you a batch of frames plus the frame count, fps, width and height as separate outputs. Video-gen nodes (and especially the img2vid / vid2vid workflows this pack was built for) need that metadata as much as they need the pixels, and most loaders make you recover it yourself.

    It's the kind of node that got a small r/comfyui demo back in January 2024 - "Download short-clips from youtube with custom node by Komojini" - and that clip-downloading use case is still its best party trick: set a start and end time, and pull a few seconds out of any embeddable YouTube video for local processing.

    How it works. Under the hood it's OpenCV (cv2.VideoCapture) for files and pytube for YouTube. For a file source it seeks to start_sec, reads frames, and stops at end_sec (0.0 means run to the end). frame_load_cap caps how many frames you get back and the loader quietly lowers the effective fps to fit the duration - it never adds frames, it just samples sparser. max_fps is a separate clamp. force_size resamples to one of the preset aspect boxes (256x?, ?x512, 512x512, …) with a lanczos upscale; the UI also adds a "Custom Width / Custom Height" option plus a live video preview and an upload button, all wired in by the pack's JavaScript. YouTube videos get downloaded to ComfyUI/output/youtube/ first, then read the same way. Pick emptyvideo and it just builds a black frame_count × width × height tensor for you.

    The inputs that matter. For a beginner, four are worth knowing:

    • source - fileupload / filepath / YouTube / emptyvideo. This decides which of the other fields are relevant.
    • start_sec / end_sec - the trim window; end_sec 0.0 = to the end.
    • frame_load_cap (default 50) - max frames returned; this is the one that keeps a 4K 2-minute clip from exploding your RAM.
    • force_size - resample to an aspect ratio box, or leave Disabled.

    Outputs are images (IMAGE), frame_count, fps, width, height (all INT). Wire images into a VAE encode / sampler / whatever consumes frames, and feed fps into your VideoCombine downstream.

    Install. One pack installs everything:

    ComfyUI Manager → search "komojini-comfyui-nodes" → Install → restart
    

    or cd ComfyUI/custom_nodes && git clone https://github.com/komojini/komojini-comfyui-nodes. Its requirements.txt pins pytube==15.0.0 and needs opencv-python, numpy, pillow, psutil and gputil. No model files - the video models are your own checkpoints.

    Where people get burned. Pinned pytube 15.0.0 is the big one: YouTube changes its internals regularly and pytube breaks with it, so "VideoUnavailable" or extraction errors are the classic failure. Also note only videos whose owners allow embedding are downloadable - the demo post says this outright. And it's a Feb-2024 pack: the preview/upload JS leans on older ComfyUI internals, so if the video preview doesn't render on a current build, that's the era talking. If you just want to load a local file reliably and skip the YouTube flakiness, there are better-maintained alternatives (VHS does this with far more love) - but for a one-stop clip-grabber, this still does the job.

    Categorykomojini/Video

    Inputs (13)

    NameTypeDefaultDescription
    sourceCOMBO4 options: fileupload, filepath, YouTube, emptyvideo
    youtube_urlSTRINGyoutube/url/here—
    videoSTRINGX://insert/path/here.mp4—
    uploadCOMBO0 options:
    start_secFLOAT0.00–10000—
    end_secFLOAT0.00–10000—
    max_fpsINT-1-1–30—
    force_sizeCOMBO9 options: Disabled, 256x?, ?x256, 256x256, 512x?, ?x512, +3
    frame_load_capINT501–10000—
    widthINT51264–8192—
    heightINT51264–8192—
    frame_countINT11–4096—
    fpsINT101–1000—

    Outputs (5)

    NameTypeDescription
    imagesIMAGE—
    frame_countINT—
    fpsINT—
    widthINT—
    heightINT—