Image Batch to GIF
Turn a frame batch into an animated GIF (base64 and all)
- images
- gif_data
Image Batch to GIF takes the frames in an image batch and stitches them into an animated GIF. It's the endpoint for "I generated a sequence of frames and I want to see it move" - feed it the IMAGE batch coming out of a video sampler or a batch of animation frames, pick a frame rate, and it hands back the GIF.
The one thing to know up front, because it will trip you up the first time: the gif_data output is not a file path. It's a JSON string with the base64-encoded GIF buried inside a data field, alongside metadata (filename, frame count, duration, dimensions). There's no "Save" button and nothing gets written to disk. To actually get a .gif file you either decode that base64 yourself or plug the output into another pack that knows how to turn it into a file. It's an unusual design - the node is built for workflows where the GIF is destined for something programmatic, like an upload - and it's the first thing a beginner will hit.
Inputs that matter
images(required) - the frame batch. A 4D tensor,[batch, height, width, channels], so a normalIMAGEoutput works.frame_duration(required) - milliseconds per frame, 10–5000, default 100. That's 10 fps at the default; raise it to 200 for a slower 5 fps feel.filename(required) - the base name for the GIF, no extension. Default "animation".loop- whether it loops, default true.add_frame_numbers- stamps "Frame N" in the corner of each frame. Handy for reviewing generated sequences, annoying for the final product.optimize- PIL's GIF optimizer, default true. Worth leaving on; animated GIFs bloat fast.
Outputs
One output, gif_data - a STRING. It's JSON with the base64 GIF in data plus metadata fields. If you're feeding it into the pack's own Media Upload or another tool that expects base64, great; if you want a file, decode it:
python -c "import json,base64,sys; d=json.load(sys.stdin); open(d['filename'],'wb').write(base64.b64decode(d['data']))"
Installing it
ComfyBros installs like any custom node pack. ComfyUI Manager - search "ComfyBros" - or:
cd ComfyUI/custom_nodes
git clone https://github.com/turnbros/ComfyBros
Then restart ComfyUI. The README references a requirements.txt that doesn't exist; the deps are in pyproject.toml (and this node uses PIL, which is included). The node lives under ComfyBros/Image Utils.
Gotchas
The base64-in-JSON output is the big one - don't go hunting for a file on disk. Also note that the default 100 ms/frame is snappy; for an actual "animation" vibe you'll usually want longer durations. And if you feed it a single image rather than a batch, you'll get a one-frame GIF, which is technically valid and entirely pointless - give it multiple frames.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| frame_duration | INT | 10010–5000 | Duration of each frame in milliseconds |
| filename | STRING | animation | Filename for the GIF (without extension) |
| loopopt | BOOLEAN | true | Whether the GIF should loop |
| add_frame_numbersopt | BOOLEAN | false | Add frame numbers to each frame |
| optimizeopt | BOOLEAN | true | Optimize GIF file size |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| gif_data | STRING | — |