🔶 Convert img2gif -> GIF
Turn a folder of frames into a GIF, no ffmpeg required
- merge_folders
- Info
The last step in this pack's animation pipeline. You've generated a sequence of frames - one per queue run, via the img2video or txt2video KSamplers, or from anywhere else - and now you need them stitched into something you can actually share. This node points at a folder of images and writes out a GIF, no ffmpeg install or external tool involved.
What it does
Image_dir is the folder containing your frames. filename_prefix (default "gif") names the output file. FPS (default 10) sets playback speed - no interpolation happening here, it's a straight frame-rate assembly, so a low FPS on a short sequence will look choppy rather than smooth; you need enough source frames to fill the gap, not just a lower number. Loop picks the playback pattern: Start->END->Start ping-pongs back and forth, Start->END plays through once and loops from the beginning again - useful distinction if your sequence doesn't naturally end where it began and a hard loop-cut would be jarring.
The optional merge_folders input (PATH type, from a folder-picker node elsewhere in the pack) lets you combine frames from more than one directory into a single GIF - handy if you generated a sequence in separate batches and want them stitched as one continuous output rather than re-running everything through a single unbroken queue.
This node is a terminal output node (is_output_node is true in its definition) - it writes the GIF to disk itself rather than passing anything on to another node. Its only output is Info, a status string, not something meant to feed further processing.
Why you'd reach for it
If you've been using this pack's frame-by-frame animation trick at all, you need something to turn the resulting folder of stills into a playable file, and this is the pack's own answer to that rather than making you export frames and run ffmpeg separately. It's also useful more generally for any folder of sequential images you want as a quick GIF - you don't strictly need to have generated them through this pack's KSamplers.
Installing it
Through ComfyUI Manager: search "Chaosaiart-Nodes," or "Install via Git URL" with https://github.com/chaosaiart/Chaosaiart-Nodes, then restart ComfyUI. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/chaosaiart/Chaosaiart-Nodes, restart. This is the one node in the pack where the Linux dependency step actually matters directly to you: run pip install opencv-python and pip install tqdm (with your venv active first, if you're using one) - GIF assembly leans on OpenCV, and skipping this step is the most likely reason this specific node fails outright rather than just some other part of the pack. Windows users get a bundled Install_windows script that handles it. No model downloads needed.
Troubleshooting
A ModuleNotFoundError mentioning cv2 on load means you skipped the opencv-python install step above - go back and run it inside whatever Python environment ComfyUI is actually using (this trips people up when they have a venv they forgot to activate before installing). If the output GIF is empty or errors out, double-check Image_dir is a path ComfyUI's process can actually see - an absolute path is safer than a relative one if you're unsure what ComfyUI's working directory is - and that the folder genuinely contains sequentially-ordered image files. If the GIF looks like a slideshow rather than smooth motion, that's an FPS-versus-frame-count mismatch, not a bug: either lower FPS further, or generate more frames upstream before assembling. And if you're merging multiple folders and the sequence order looks wrong, remember merge_folders combines directories - it doesn't reorder file names for you, so keep your naming consistent across folders going in.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| Image_dir | STRING | — | |
| filename_prefix | STRING | gif | — |
| FPS | INT | 101–18446744073709550000 | — |
| Loop | COMBO | 2 options: Start->END->Start, Start->END | |
| merge_foldersopt | PATH | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Info | STRING | — |