Nodes/Various ComfyUI Nodes by Type/Batch Save Image Sequence
ComfyUI Node

Batch Save Image Sequence

Write an image batch out as numbered frames

By jamesWalker55·Created 3 years ago·Updated about a year ago· 215
Batch Save Image Sequence
  • images
    path_pattern./frame{:06d}.png
    start_index0
    overwritetrue

    JWSaveImageSequence takes a batch of images and writes each one to disk as a numbered frame - frame000000.png, frame000001.png, and so on - following a pattern you control. It's the write half of a frame-based video workflow: you loaded frames, ran them through AnimateDiff or a per-frame img2img pass, and now you need them back on disk as an ordered sequence you can feed to ffmpeg or a video encoder.

    The reason to save frames instead of muxing straight to a video file is control and safety. Frames on disk survive a crash, let you inspect or re-encode without rerunning the graph, and hand off cleanly to whatever assembles the final clip. It's the same round trip that makes this pack a common quiet dependency in video workflows: load a sequence, transform, save a sequence.

    How it works

    It walks the batch and writes each image to a path built from the pattern, incrementing the number for each frame starting at start_index. The default ./frame{:06d}.png produces 6-digit zero-padded names - which matters, because zero-padding is what keeps frame000009 sorting before frame000010 in the encoder. It's an output node (the end of a branch), so it produces no wire out; running the graph triggers the writes.

    The inputs and outputs that matter

    • images (IMAGE) - the batch to write out.
    • path_pattern (STRING) - the filename pattern with a {:06d}-style number placeholder, default ./frame{:06d}.png. Set the folder, digit count, and extension to taste.
    • start_index (INT, default 0) - the number the first frame gets. Useful for appending to an existing sequence without overwriting.
    • overwrite (enum: false / true, default true) - whether to replace files that already exist at those paths.
    • No output wire - it's a terminal save node.

    How to install it

    Part of jamesWalker55/comfyui-various, a pack of small utility nodes.

    • ComfyUI Manager: search "Various ComfyUI Nodes by Type", install, restart. Red node in a downloaded workflow? Install Missing Custom Nodes.
    • Manually:
      cd ComfyUI/custom_nodes
      git clone https://github.com/jamesWalker55/comfyui-various
      
      Restart afterward. No models, no dependencies.

    Under the jamesWalker55 category after restart.

    Common issues

    • Keep the zero-padding. A pattern without padding (frame{:d}.png) produces frame9, frame10 that sort in the wrong order, and ffmpeg's numbered-input reader expects consistent-width numbers. Stick with {:06d} (or match whatever your encoder wants) so frames line up correctly.
    • Frames overwrote a previous render. With overwrite on true and a reused pattern, a new run replaces the old frames. Write to a fresh folder per run (build the path with a JWDatetimeString stamp), or bump start_index, to avoid clobbering results you wanted to keep.
    • Cloud/serverless disk is ephemeral. The pattern writes to the server's filesystem, and ./frame... resolves against ComfyUI's working directory - not your computer. On a hosted or serverless host, local disk is often wiped when the worker spins down, so frames written to a local path can disappear before you retrieve them. If you're remote, make sure the output lands somewhere the platform persists and serves back, rather than an arbitrary local path.
    • Missing folder / permissions. The target directory usually has to exist and be writable. Create it first and point somewhere ComfyUI can write.
    • Node is red / missing. The pack isn't installed. Install via Manager or clone the repo, then restart.

    Its counterpart is JWLoadImageSequence for reading frames back in. Together they bookend the frame-in / frame-out pattern that a lot of ComfyUI video work is built on.

    CategoryjamesWalker55

    Inputs (4)

    NameTypeDefaultDescription
    imagesIMAGE
    path_patternSTRING./frame{:06d}.png
    start_indexINT0
    overwriteCOMBOtrue2 options: false, true

    Outputs (0)

    No outputs