🔥Frames2Video
Stitch a folder of images back into an mp4
- frame_path
- output_path
Frames2Video is the return trip from Video2Frames (or from ImagesSave, the pack's tensor-to-disk node). Point it at a directory full of PNGs, give it an fps, and it encodes them into a single mp4. This is the node that closes the loop on every "video → AI-processed frames → video" workflow, which is the bread and butter of ComfyUI video work - same reason people keep VHS tapes of their own pipelines, essentially.
How it works
It lists every image in the folder, sorts by filename, guesses the frame dimensions from the first image, then hands FFmpeg a number-pattern template - so frame_00000042.png becomes frame_%08d.png and FFmpeg decodes them in order. Encoding defaults to libx264 at crf 28 (small file, slightly soft), or h264_nvenc at cq 22 if you set device to GPU. That GPU option is only meaningful on an NVIDIA card - it won't magically speed things up on AMD or Apple silicon.
The inputs that matter
- frame_path - the directory of images. Must exist and contain at least one image.
- fps - frame rate, default
30, min1, max120. This is where people silently ruin their videos. If you extracted at 24fps and rebuild at 30, your clip runs ~25% too fast. Save yourself the headache: wire thefpsoutput from Video2Frames straight in here. - video_name - filename (no extension needed,
.mp4is appended). The output lands in output_path, which again must be a pre-existing directory. - audio_path - optional. Drop in the
audio.mp3that Video2Frames left next to your frames and the finished clip gets its soundtrack back. If you pass a path that doesn't exist, the node errors out, so leave it empty when you don't have one.
Outputs
Returns frame_path and output_path (the full path to the finished mp4) - both plain strings. There's no video preview widget here; you write the file and go look at it on disk.
Install
Same pack-wide story: the Python side is essentially nothing (requirements.txt is just pathlib), so the only real dependency is FFmpeg on your PATH. Install the pack via ComfyUI Manager (search "ComfyUI-FFmpeg") or:
cd ComfyUI/custom_nodes
git clone https://github.com/MoonHugo/ComfyUI-FFmpeg
cd ComfyUI-FFmpeg
pip install -r requirements.txt
then restart ComfyUI.
Gotchas
- Output files are auto-named with a timestamp, so you won't overwrite your previous render - but you also won't know which file is which without checking the clock.
- The images must be sorted-numeric to encode in the right order. The pack's own ImagesSave node writes zero-padded names (
output_image_000000001.png) precisely so this works. If you dump frames from other tools, make sure they're zero-padded - lexicographic sort will otherwise putframe_2.pngafterframe_19.png. - Odd frame dimensions can trip up
libx264; the encode will error with an "even width/height" complaint if your frames are odd-sized. Scale them to even dimensions first.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| frame_path | STRING | C:/Users/Desktop | — |
| fps | FLOAT | 301–120 | — |
| video_name | STRING | new_video | — |
| output_path | STRING | C:/Users/Desktop/output | — |
| device | COMBO | CPU | 2 options: CPU, GPU |
| audio_pathopt | STRING | C:/Users/audio.mp3 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| frame_path | STRING | — |
| output_path | STRING | — |