Nodes/Chaosaiart-Nodes/🔶 Convert img2video -> mp4
ComfyUI Node

🔶 Convert img2video -> mp4

Stitch a folder of frames into a video, no ffmpeg needed

By chaosaiart·Created 2 years ago·Updated about a year ago· 117
🔶 Convert img2video -> mp4
  • merge_folders
  • Info
â—„Image_dirâ–º
â—„filename_prefixvideoâ–º
â—„FPS10â–º

Once you've run one of this pack's frame-by-frame sequences - a checkpoint or prompt changing every generation, denoise handled by Denoising_Switch, everything saved out as individual images - you end up with a folder of stills, not a video. This node is the last step: point it at that folder, give it an FPS, and it writes an mp4. It's an output node - set as is_output_node, it actually terminates the graph and produces a file, it doesn't pass anything forward for further processing.

The one thing worth knowing before you reach for this instead of VideoHelperSuite's Video Combine or a similar node: this pack's README lists opencv-python as a required dependency for exactly this reason. That means it's almost certainly using OpenCV's own video writer rather than shelling out to ffmpeg - which is convenient (you don't need ffmpeg installed and on your system PATH) but also means you're working within whatever codecs OpenCV's VideoWriter supports on your platform, not the much broader container/codec flexibility ffmpeg-based nodes give you. For a straightforward "turn my saved frames into a shareable mp4," it's fine; for fine control over encoding, a dedicated video-combine node from a different pack is the better tool.

Inputs and outputs

  • Image_dir - required STRING, default empty. The folder containing your frame images, in the order you want them stitched.
  • filename_prefix - required STRING, default "video". What the output mp4 gets named.
  • FPS - required INT, default 10, min 1. Playback speed - how many of your saved frames play per second in the output.
  • merge_folders (optional, PATH type) - stitch frames from more than one folder together into a single output video, if your sequence was split across multiple directories.
  • Output: Info - a STRING report, since this is an output node and there's nothing to pass downstream.

Installing it

ComfyUI Manager: Install via Git URL → https://github.com/chaosaiart/Chaosaiart-Nodes, the method the README documents directly. A title search for "Chaosaiart" should also find it.

Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/chaosaiart/Chaosaiart-Nodes

Linux (activate your venv first, if you use one):

pip install opencv-python
pip install tqdm

Windows: run the Install_windows script bundled in the pack folder - it handles the same two Python packages. Restart ComfyUI after either method. This node specifically needs opencv-python to actually function, so if it errors out on use, that's the first thing to verify installed cleanly.

Common issues

Node fails to run, or the whole pack won't load. All ~20 Chaosaiart nodes share a single Python module, so if opencv-python didn't install correctly, you won't just lose video stitching - you'll lose the entire pack from ComfyUI's node list. Check the startup console for an import error and re-run pip install opencv-python (inside your venv, if you use one) before troubleshooting anything else.

Output video is empty or wrong length. Image_dir is pointing at the wrong folder, or your frame-by-frame sequence saved images somewhere other than where you expect (check your Save Image node's actual output path, not just what you assume it is).

Frames play in the wrong order. OpenCV-based writers typically read a directory in filename order - if your saved frames aren't zero-padded (frame1.png, frame2.png, ... frame10.png sorts as 1, 10, 2, ...), you'll get a shuffled video. Make sure your Save Image prefix produces consistently padded numbering.

Category🔶Chaosaiart/video

Inputs (4)

NameTypeDefaultDescription
Image_dirSTRING—
filename_prefixSTRINGvideo—
FPSINT101–18446744073709550000—
merge_foldersoptPATH—

Outputs (1)

NameTypeDescription
InfoSTRING—