Load Image/Video From Path
The loader that actually handles video, GIFs, and audio
- images
- mask
- audio
- frame_count
- fps
ComfyUI's built-in Load Image node is fine for a still PNG and useless for everything else. Feed it an MP4 and it'll treat the file as garbage or not even let you pick it. Load Image/Video From Path is the fix: type a path, get frames, an alpha mask, the audio track, and an FPS value out the other side. It's part of the LoadAnim-Adv pack from SineSwiper, and it's the node you want when your source material is an animated GIF, a video clip, or an image sequence sitting somewhere outside ComfyUI's input folder.
What it does
This is the "give me a path" variant of the pack's loader. Its sibling, Load Image/Video, shows you a dropdown of files in ComfyUI's input directory with an upload button. This one just takes a string - absolute or relative path - and opens whatever you point it at. Same internals, different way of choosing the file. If you work with material that lives elsewhere on disk, or you're generating the path dynamically (say, from a file-list node further up the graph), this is the one to use.
How it works
The node sniffs the MIME type of the file to decide what it's dealing with, then forks:
- Video (mp4, avi, mov, mkv): it decodes frames through ComfyUI's own
VideoFromFilehelper, which is ffmpeg under the hood. No extra pip packages, no PyAV, nothing heavy - this pack'srequirements.txtis justtorch,numpy, andPillow, all of which a stock ComfyUI already has. - Animated images (GIF, animated WebP): it walks the frames with Pillow's
ImageSequence.Iteratorand stacks them into a single IMAGE tensor. - Either way you get a
frame_countand anfps- fps pulled from metadata, or derived from the animation duration when it isn't reported. Still images come back as a one-frame tensor with an fps of 0.
The inputs that matter
path- the file path. The only field you must fill in.RGBA- default off. When on, theimagesoutput keeps the alpha channel. Themaskoutput always carries transparency data, so you can usually leave RGBA off and grab the mask.width/height- target dimensions after resizing. 0 means keep the original size. The step is 16, which is deliberate: it keeps you honest about alignment for the sampler.keep_aspect_ratio-crop,pad, orstretch. Crop center-crops to the target, pad letterboxes with the detected edge color, stretch squashes. Default is crop.
Outputs
images (IMAGE), mask (MASK), audio (AUDIO), frame_count (INT), fps (FLOAT). The audio output is the interesting one - very few loaders bother, and it only shows up for video files. Fair warning: most downstream video nodes can't consume an AUDIO tensor, so if you want the soundtrack in your final render you'll be wiring that output to an audio-aware node.
Installing
The pack is called ComfyUI-LoadAnim-Adv. Easiest path is ComfyUI Manager → Custom Nodes Manager → search "LoadAnim" → Install. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/SineSwiper/ComfyUI-LoadAnim-Adv.git
Then restart ComfyUI. No model downloads, no build step.
Gotchas
fpscan legitimately be 0 - for still images, or when the metadata is missing. Don't panic, just don't divide by it.- Resizing happens per frame, so a 500-frame clip resized to 1024×1024 costs what it costs. Keep
width/heightat 0 unless you actually need them. - The frame selection syntax from the rest of the pack doesn't apply here - this node loads everything. If you want to cherry-pick frames, pipe
imagesinto Select Indexes From Images.
It's not glamorous, but it's the kind of node that quietly removes a whole category of "why won't this load" frustration from your video workflow.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | Absolute or relative path to the image/video file. | |
| RGBA | BOOLEAN | false | Controls whether to include the Alpha channel in the 'image' output. The 'mask' output will always include this data. |
| width | INT | 0 | Final width of images, after resizing. Zero means to keep the original width. |
| height | INT | 0 | Final height of images, after resizing. Zero means to keep the original height. |
| keep_aspect_ratio | COMBO | What action to take, when the image doesn't match the expected aspect ratio. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | The image data, either as a single image or a set of frames. |
| mask | MASK | Any transparency data found in the Alpha channel or transparent palette index. |
| audio | AUDIO | The audio from the video, if any. |
| frame_count | INT | Total number of frames loaded from the image. |
| fps | FLOAT | Frames-per-second, as reported from the image metadata. This may be zero, if the data could not be found, or the image doesn't animate. |