Nodes/jayhuang-zip-unpack-images/Video to Frames (with Audio)
ComfyUI Node

Video to Frames (with Audio)

Turn a VIDEO object into frames (and its audio) for img2img or keyframing

By jayhuangaigc·Created 7 months ago·Updated 7 months ago· 3
Video to Frames (with Audio)
  • video
  • frames
  • audio
  • video_info
every_n_frames1
max_frames0

Most video work in ComfyUI starts the same way: you've got a video and you need frames. A few animation workflows can consume a VIDEO object directly, but the standard img2img loop, frame-interpolation chain, or keyframe pipeline wants plain IMAGE tensors. This node is the bridge - it takes a ComfyUI VIDEO input and hands back an IMAGE batch, the audio track, and a metadata dict, all in one go.

How it works

Internally it reads the video's decoded components - the frame tensor, the frame rate, and the audio track if one exists - via ComfyUI's get_components(). It also records a video_info dict with width, height, fps, total frame count, duration, whether it has audio, and the source file size. Nothing is decoded twice; it's reading what ComfyUI already extracted when the VIDEO object was created.

Two knobs do the actual work:

  • every_n_frames (default 1) - keep every Nth frame. Set it to 2 and you halve the batch; 5 gets you a fifth of the frames. This is your cheap way to control how much work a downstream img2img pass does.
  • max_frames (default 0) - cap the total frame count, mostly a safety valve for long clips. 0 means no cap.

The frames output is a proper IMAGE batch (tensor list), so it plugs straight into a VAE Encode, a Save Image sequence, or anything that eats a batch of frames. The audio output is an AUDIO dict - even if the video has no sound, you get a silent placeholder rather than a crash, which keeps the wire alive. It's there so you can split a clip into frames, process them, and still carry the audio alongside to a Save to ZIP node for re-packing.

Why you'd reach for it

Where does this actually sit in a workflow? Load ZIP (this same pack) gives you VIDEO objects straight out of an archive - this node is the natural next hop that turns them into workable frames. Or feed it any other pack's video loader output. Pair it with Video Frame Relay downstream and you've got a two-node video → representative-frames pipeline for something like a title thumbnail. The video_info output is also handy as an inspected dict if you want frame counts or fps written into a filename or logged.

Installing

Same pack, same routine:

cd ComfyUI/custom_nodes
git clone https://github.com/aixqueen/jayhuang-zip-unpack-images.git

Restart ComfyUI. (Or ComfyUI Manager → search jayhuang-zip-unpack-images.) No models to fetch; the only declared dependency is soundfile, which this node doesn't even touch - it's for Load ZIP's non-WAV audio decoding.

Gotchas

The frames output is a list of tensors, not one stacked tensor - if you're wiring it into a node that expects a single IMAGE, you may need to let ComfyUI's batch semantics handle the list (list outputs fan out over executions), or feed it through something that stacks. And as with the rest of this pack, you're trusting a tiny single-commit repo from an author with no real community track record - the code is short and readable, which is exactly how it should be checked.

CategoryJAYHUANG/Zip

Inputs (3)

NameTypeDefaultDescription
videoVIDEO
every_n_framesoptINT11–120
max_framesoptINT00–100000

Outputs (3)

NameTypeDescription
framesIMAGE
audioAUDIO
video_infoJAYHUANG_VIDEOINFO