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

🎥Ultimate Video Loader (simple)🎥

Four Video Sources in One Node — and It Won't Clutter Your Graph

By komojini·Created 3 years ago·Updated 2 years ago· 77
🎥Ultimate Video Loader (simple)🎥
    • 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â–º

    The thing every vid2vid workflow needs is a way to get real video frames into the graph, and this is the node that does it without making you babysit four different loaders. UltimateVideoLoader (simple) from the komojini-comfyui-nodes pack is a single node that reads video from a local file path, a file you upload, a YouTube URL, or - weirdly handy - generates empty/black frames. You feed it a source, it hands you an IMAGE tensor plus the frame count, fps, and dimensions, ready to wire into a KSampler, an AnimateDiff-style pipeline, or whatever Wan or LTX workflow you're running. The full version of this node is the same thing with an embedded video preview; "simple" skips the preview widget, so it renders small, stays out of your way, and still does the whole job.

    How it actually works

    Under the hood it's OpenCV doing the heavy lifting - cv2.VideoCapture opens the file (mp4, webm, mkv, and gif all work), reads the frames you asked for, converts each one from BGR to RGB, normalizes to 0–1 floats, and stacks them into a [frames, height, width, 3] tensor in ComfyUI's standard image format. There's no exotic frame loader here, no PyAV, no decoder dependency to fight - just opencv-python, which is why the pack installs cleanly.

    The clever bit is the frame sampling. Instead of dumping every frame on you, the node picks frames with a stride (step) sized so that the clip you selected lands at frame_load_cap frames, and it reports the effective fps - the original fps divided by that stride. It will never invent frames or up-sample your source, which is the right call for feeding image-to-video models that need exact control over what they see.

    The inputs that matter

    You'll actually touch about four of these:

    • source - pick one of fileupload, filepath, YouTube, or emptyvideo. That's the whole personality of this node.
    • start_sec / end_sec - clip the video. 0 for start means the beginning; 0 for end means run to the end of the file. The YouTube-clipping workflow is the author's original pitch and it works.
    • frame_load_cap - max frames returned. Default is 50, and this is the trap.
    • max_fps - cap the output rate (-1 or 0 disables, per the README).

    force_size gives you the usual 512x?, ?x512, 512x512 style presets - the ? keeps aspect ratio and the result is rounded to a multiple of 8 so it encodes cleanly into latents. The width, height, frame_count, and fps fields exist only for the emptyvideo source: they synthesize a black tensor of exactly those dimensions, which is a neat way to test a video pipeline or prime a model before real footage arrives. Outputs are images, frame_count, fps, width, and height - you'll mostly wire images into your pipeline and use fps/frame_count downstream if you're reconstructing video later.

    Installing it

    ComfyUI Manager search for komojini-comfyui-nodes, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/komojini/komojini-comfyui-nodes
    

    then restart ComfyUI. The requirements.txt pulls in pytube==15.0.0 (pinned - that matters, see below), opencv-python, numpy, torch, pillow, psutil, and gputil. No model files to download; Manager will offer to install the deps.

    Where people get burned

    Three things, all real:

    1. frame_load_cap silently downsamples you. Default 50 means a 10-second, 30fps clip comes out as 50 frames at ~5fps, and nothing screams about it. If you want every frame, set the cap above the clip's frame count (the field maxes at 10000). The fps output is your friend - check it if motion looks stuttery.
    2. YouTube is fragile by design. The node downloads through pytube, which breaks whenever YouTube twitches its internals (a recurring ritual), and it can only fetch videos the owner allows to be embedded on other sites - that's a pytube constraint, not the node's. Also note the download lands in ComfyUI/output/youtube/. The local-file path is rock solid; treat YouTube as the convenient-but-fragile option.
    3. Don't confuse "simple" with "less capable." It's the identical node minus the preview widget - same class, same outputs. The preview in the full version is nice for checking your clip before generation; "simple" is what you want if you're packing this into a shared workflow or just want the graph tidy.

    This is a small, personal-utility pack from a solo dev (posted on r/comfyui in early 2024), and the loader is the most genuinely useful thing in it. Fancier loaders exist with audio support and VHS-style conveniences, but if you want one node that covers path, upload, YouTube, and a blank canvas - and you're OK with the YouTube caveats - this is it.

    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—