Nodes/Egregora Frames Animation Nodes for ComfyUI/Multi-Format Animation Encoder
ComfyUI Node

Multi-Format Animation Encoder

The export node that writes your GIF, MP4, and WebM at once

By lucasgattas·Created 11 months ago·Updated 7 months ago· 2
Multi-Format Animation Encoder
  • frames
    fps12
    final_output_fps0
    loop_mode
    loop_duration_seconds10.0
    loop_count3
    filename_prefixanimation
    output_directory
    save_gif
    save_mp4
    save_webm
    save_avi
    save_mov
    save_mkv
    quality90
    auto_open_folder

    This is where the pipeline spits out the goods. Multi-Format Animation Encoder takes your finished frame sequence - from Batch Animation Processor, the Advanced Batch Loader, or any IMAGE batch - and writes it to disk as GIF, MP4, WebM, AVI, MOV, or MKV. All of them, in one run, from one node. It's the terminal node of the Egregora pack: no outputs, just files landing in your output folder.

    Why would you want six formats at once? Because the same animation is going six places - GIF for Discord and the web, MP4 for Twitter/Reddit, MOV or MKV for an editor timeline. Rendering once and exporting in one pass beats running the workflow six times or hand-converting afterward. That's the honest use case; if you only ever need an MP4, this node is more knobs than you need.

    How it works

    It reads frames (IMAGE), sets the timeline from fps, and applies loop_mode before encoding: no_loop, loop_duration (repeat until roughly loop_duration_seconds, then trim), or loop_count (repeat N times). final_output_fps (0 = same as fps) re-times by resampling frames while preserving duration - it duplicates frames to hit a higher rate rather than speeding anything up.

    Then the format toggles. Under the hood each one takes a different path:

    • GIF - Pillow, frame by frame. Works, but it's a palette format; gradients band.
    • MP4 / MOV / MKV - imageio with the ffmpeg binary bundled by imageio-ffmpeg, h.264 (libx264) encoding.
    • WebM - imageio with libvpx-vp9. Quality is good; speed is not - VP9 is a slow encoder.
    • AVI - here's the trap: imageio encodes AVI with a PNG codec, so your "video" is essentially a stack of PNG frames in a container. The file is enormous. Only enable AVI if you genuinely need it.

    Filenames are filename_prefix_0001.ext with a counter that auto-increments past existing files, so you won't overwrite anything. auto_open_folder pops the folder in your OS file manager when done.

    The inputs that matter

    • frames - the sequence. Comes straight out of Batch Animation Processor's processed_frames.
    • The six save_* toggles (save_gif, save_mp4, save_webm, save_avi, save_mov, save_mkv) - each is disabled/enabled. Enable only what you'll actually ship; every enabled format costs encode time and disk.
    • loop_mode - remember the GIF is only looped if you pick loop_duration or loop_count. A no_loop GIF plays once and stops, which looks broken.
    • filename_prefix + output_directory - empty directory = ComfyUI's default output.
    • quality (optional, default 90) - this one's used by imageio; 60–70 is usually fine for web.

    No outputs - it's a dead end, by design. Watch the console for Saved GIF: ... lines to confirm.

    Install

    Pack-wide again: ComfyUI Manager → "Egregora Frames Animation", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/lucasgattas/ComfyUI-Egregora-Frames-Animation-Nodes.git
    cd ComfyUI-Egregora-Frames-Animation-Nodes
    pip install -r requirements.txt
    

    Video export specifically needs imageio and imageio-ffmpeg, both in requirements.txt. There's an OpenCV fallback for MP4/AVI if imageio is missing, but install the real thing and use it.

    Where people get burned

    • "No output formats enabled" - enable at least one save_* toggle; the node prints a warning and does nothing otherwise.
    • AVI is a disk monster - PNG-in-container AVI files are gigabytes for short clips. Skip AVI unless a client demands it.
    • WebM feels slow - that's VP9 being VP9. Use it, then go do something else.
    • No audio - this encodes frames only. If your animation needs a soundtrack, you're compositing that elsewhere. Nobody's surprised, but it's worth saying once.
    CategoryEgregora/animation

    Inputs (16)

    NameTypeDefaultDescription
    framesIMAGE
    fpsINT121–60
    final_output_fpsINT00–120
    loop_modeCOMBO3 options: no_loop, loop_duration, loop_count
    loop_duration_secondsFLOAT10.00.1–300
    loop_countINT31–100
    filename_prefixSTRINGanimation
    output_directorySTRING
    save_gifCOMBO2 options: disabled, enabled
    save_mp4COMBO2 options: disabled, enabled
    save_webmCOMBO2 options: disabled, enabled
    save_aviCOMBO2 options: disabled, enabled
    save_movCOMBO2 options: disabled, enabled
    save_mkvCOMBO2 options: disabled, enabled
    qualityoptINT901–100
    auto_open_folderoptCOMBO2 options: disabled, enabled

    Outputs (0)

    No outputs