Nodes/comfy_Pond_Nodes/🐳GIF保存
ComfyUI Node

🐳GIF保存

When your frames are worth keeping, this is the save node

By Pondowner857·Created about a year ago·Updated 21 days ago· 45
🐳GIF保存
  • images
  • gif_path
filename_prefixGIF
frame_duration100
loop_count0
optimizetrue
reversefalse
ping_pongfalse

The pair to Pond's PreviewGIF. Preview is the throwaway - it renders your frame batch as an animated GIF in the UI so you can check the motion. SaveGIF is the keeper: it takes the same batch and writes a real, permanent animated GIF to your ComfyUI/output/ folder, with a filename prefix you control, frame timing, looping, and two genuinely useful frame-ordering tricks.

From 🐳 Pond Nodes (comfy_Pond_Nodes), under 🐳Pond/GIF, display name "🐳GIF保存." If you've animated anything - a walk cycle, an img2img pan, video model output frames - you've already wanted this exact node.

How it works

Mechanically it's the same pipeline as the preview node: each frame tensor becomes a PIL image, quantized to a 256-color median-cut palette (GIFs are palette-constrained by format, no way around it), then Pillow writes the whole stack as one animated file with per-frame duration and loop. The save path uses ComfyUI's standard filename machinery, so you get the usual prefix_counter.gif numbering and collision-safe filenames.

The extra controls are where it earns its keep:

  • filename_prefix - default "GIF", appears in ComfyUI/output/GIF_00001.gif style names.
  • frame_duration (20–5000 ms, default 100) - per-frame time. 100 ms ≈ 10 fps.
  • loop_count (0–100, default 0) - 0 loops forever, the default for GIFs.
  • optimize (default on) - lets Pillow apply palette optimization, shrinking file size.
  • reverse - flips the frame order, so the animation plays backward. One click instead of re-ordering your batch.
  • ping_pong - plays the sequence forward then backward (A B C B A), the classic loop for walks and bounces. Only kicks in with more than two frames.

One output: gif_path (STRING), the full path to the saved file - handy if you want to log it or pass it to another tool. It's an output node, so it always runs and terminates its branch.

Installing it

The pack install is the same as everywhere - Manager search comfy_Pond_Nodes, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Pondowner857/comfy_Pond_Nodes
cd comfy_Pond_Nodes
pip install -r requirements.txt

Restart, under 🐳Pond/GIF. Pillow-only; no heavy dependencies required. (Pack-wide: the README warns of a console-spam conflict with comfyui_HiDream-Sampler.)

The gotcha

GIFs are lossy-by-palette and gigantic by nature. Don't use this as your archive master for anything you'll re-edit - the 256-color quantization is baked in, and a long high-res animation will produce a file measured in tens of megabytes. It's a share/quick-anim format, not a mastering format. Also, reverse and ping_pong are output transforms: if you need both the original order and the reversed one, you'll need two SaveGIF nodes, because each node only writes one file.

Category🐳Pond/GIF

Inputs (7)

NameTypeDefaultDescription
imagesIMAGE
filename_prefixSTRINGGIF
frame_durationINT10020–5000
loop_countINT00–100
optimizeBOOLEANtrue
reverseBOOLEANfalse
ping_pongBOOLEANfalse

Outputs (1)

NameTypeDescription
gif_pathSTRING