ComfyUI Node

Load Media ⤴️

Feed actual video — and audio — into your ComfyUI graph

By fat-tire·Created 2 years ago·Updated about a year ago· 7
Load Media ⤴️
    • images
    • audio
    • fps
    • width
    • height
    • num_frames
    • duration
    • audio_sample_rate
    media_filename
    output_image_shapeB-H-W-C
    batch_size64
    frame_offset0
    frame_count0

    Want to upscale every frame of a video, restyle a clip, or caption each frame with a real model? ComfyUI's built-in Load Image only handles stills. Load Media ⤴️ is the input half of the ComfyUI Unified Media Suite: pick any media file and it decodes it into a batched image tensor, an audio tensor, and the metadata (fps, dimensions, duration) you'll need to write it back out. This is the reason to install the pack at all - video-in is the gap ComfyUI core leaves open.

    How it works

    It's PyAV, the Python binding for ffmpeg's libav - no separate ffmpeg binary needed. The node opens the container, grabs the first video stream and the first audio stream, and decodes in batches to keep VRAM bounded: a reusable tensor of batch_size frames lives on your accelerator (CUDA, MPS, or CPU), fills up, gets copied to the CPU-side result tensor, and is recycled. If the video has an alpha channel, frames come out as RGBA so transparency survives. Single images, animated GIFs, webp, mp4, mov, avi - all fair game.

    One detail worth knowing: seeking to a specific frame isn't reliable in ffmpeg (key frames vs. delta frames), so frame_offset is implemented by decoding and throwing away frames. Works fine, but a big offset on a long clip means a lot of wasted decode time.

    Inputs

    • media_filename - a dropdown of everything in ComfyUI's input folder filtered to media/image/audio/video. Upload works right from the widget.
    • batch_size (default 64) - frames decoded per GPU pass. The node's own description says it: lower batch_size if you get memory errors. It's also ignored on CPU, where the code forces 16 for speed.
    • frame_offset (default 0) - skip this many frames at the start.
    • frame_count (default 0) - load this many frames; 0 means "to the end of the file."
    • output_image_shape - B-H-W-C (ComfyUI's usual layout) or B-C-H-W (the channels-first layout some models expect). This trio of *_image_shape toggles appears across the whole pack so you can match whatever node you're wiring into.

    Outputs - the payload

    • images - the batched float32 tensor you'll actually process.
    • audio - the first audio stream as a ComfyUI AUDIO tensor, for muxing back in at save time.
    • fps, width, height, num_frames, duration, audio_sample_rate - the scalars that make round-trips work. The fps → Save Media fps connection is the one that stops your output from playing back at the wrong speed; width/height feed resizing; duration and num_frames are handy for logic.

    A typical workflow is Load Media → whatever image processing you want (upscale, LoRA pass, frame interpolation) → Save Media. The README even wires the fps output straight into the save node for "consistent speed."

    Installing it

    Part of the whole suite, so one install gets you all three nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fat-tire/comfyui-unified-media-suite
    

    or search ComfyUI Manager for "ComfyUI Unified Media Suite". The only dependency is av (PyAV) - install it into the same Python environment ComfyUI uses, then restart. No model files.

    Common issues

    • .jpg files won't load on Ubuntu - a known PyAV release bug the README calls out explicitly. For stills, just use ComfyUI's built-in Load Image; this node shines with video anyway.
    • Out of memory - drop batch_size. That's why the parameter exists.
    • Audio timing drifts - audio is a best-approximation of the video's frame offset and count. Fine for most muxing, don't plan a film-sync project around it.
    • Stills give odd metadata - a single image reports fps 0, duration 0, num_frames 1. That's expected, not a bug.

    Like its sibling Save Media, this is a Preview Beta from a single maintainer (fat-tire), so don't expect battle scars - but the basic decode path is solid PyAV and it's genuinely the lightest way to get a video and its audio into the graph at once.

    Categorymedia

    Inputs (5)

    NameTypeDefaultDescription
    media_filenameCOMBO1 options: example.png
    output_image_shapeoptCOMBOB-H-W-C2 options: B-H-W-C, B-C-H-W
    batch_sizeoptINT6432–9999
    frame_offsetoptINT0
    frame_countoptINT0

    Outputs (8)

    NameTypeDescription
    imagesIMAGE
    audioAUDIO
    fpsFLOAT
    widthINT
    heightINT
    num_framesINT
    durationFLOAT
    audio_sample_rateINT