ComfyUI Node

Build Gif

The Misnamed Node That Actually Writes WebP

By M1kep·Created 3 years ago·Updated 4 months ago· 7
Build Gif
  • images
    split_every-1
    frame_duration125
    output_modeBig Grid

    Let's start with the lie: despite the name, this node has never written a GIF in its life. It writes animated WebP files - lossless, infinitely looping, smaller than GIF - into ComfyUI's output folder. If you go looking for a .gif on disk after running it, you'll think it failed. It didn't. "Build WebP" is just a worse name.

    What it's for. Build Gif is an output node that turns a stack of image batches into a preview animation. It rides in the same pack as KepPromptLang's prompt language but has nothing to do with it - it's a utility that hitched a lift, which is why it's filed under "List Stuff" rather than conditioning. You reach for it when you have a pile of frames - AnimateDiff-era frame stacks, an img2img sequence, a batch of variations - and you want to flip through them without dragging out ffmpeg. That's the whole job, and it does it without leaving ComfyUI.

    What you set. Four inputs, and only one of them is the actual art:

    • images (IMAGE list): the frames. Worth reading the next section for, because how you feed this decides whether you get an animation or a static contact sheet.
    • split_every (INT, default -1): -1 means "the whole list is one animation." Otherwise it's how many list entries go into each chunk.
    • frame_duration (INT, default 125): milliseconds per frame. 125ms is 8 fps; drop it lower for snappier motion.
    • output_mode (enum): "Big Grid" arranges your batches into a contact sheet and animates through the timeline; "One Per Split" writes a separate animation per chunk.

    The trick that burns people. The node expects images to be a list where the list length is the animation timeline and each element is a batch whose width becomes the grid columns. Feed it AnimateDiff's raw output - one 16-frame batch tensor - and Big Grid hands you a single static 16-wide contact sheet, because there's only one timeline step. To get an actual animation you have to split your frame batch into a list of individual frames first, then wire that in. It's the kind of semantic that's obvious from the code and invisible from the UI.

    Where things land. Files are written to ComfyUI/output with the Gif prefix, so expect something like Gif_00001_.webp. Encoding is lossless, the loop runs forever, and the node reports the results back to the UI gallery - so the animation also plays in your browser preview, which is the easiest way to check it.

    Troubleshooting.

    • "List input for split_every is not supported" (same for output_mode and frame_duration): those three are meant to be single values, not lists. Only images takes a list.
    • No .gif on disk after a run: it's a .webp. Browsers play it fine; if a tool insists on GIF, convert it.
    • The last few frames vanished: split_every chunks the list by integer division, so a count that isn't a clean multiple of split_every drops the remainder. Keep the arithmetic tidy.
    • You got one still image instead of motion: you fed the whole frame batch as one list element. Split it into individual frames first.

    It's a small, honest utility - misnamed, a little quirky about lists, and genuinely handy for eyeballing batches without a second tool.

    CategoryList Stuff

    Inputs (4)

    NameTypeDefaultDescription
    imagesIMAGE
    split_everyINT-1
    frame_durationINT125
    output_modeCOMBOBig Grid2 options: One Per Split, Big Grid

    Outputs (0)

    No outputs