ComfyUI Node

FL_ZipSave

Zip a directory and actually write it to disk

By filliptm·Created 3 years ago·Updated about 17 hours ago· 628
FL_ZipSave
    • zip_path
    input_directory
    output_directory
    zip_filenamearchive.zip

    The plain version of "zip a folder": FL_ZipSave compresses a directory and writes the resulting .zip file to disk at a location you choose, with automatic collision handling so a second run doesn't clobber your first one. If you don't need a file on disk - you just want to hand a zip's bytes to another node, like an uploader - use its sibling FL_ZipDirectory instead, which does the same compression but keeps everything in memory. This one is the terminal step: is_output_node is true, meaning it's meant to end a branch of your workflow the way a save-image node does.

    A natural pairing worth knowing about: if you've been auditing a LoRA dataset with FL_WordFrequencyGraph and you're happy with the captions, FL_ZipSave is a reasonable way to bundle the finished image+caption folder into a single archive for handoff or backup once you're done.

    How it works

    Point it at a source folder and a destination folder, give it a filename, and it walks the source directory, compresses it, and writes the archive to the destination. If a file with that name already exists at the destination, the README's own description says it handles the collision "via timestamp suffixing" - meaning it appends a timestamp to the new filename rather than overwriting whatever's already there.

    The inputs and outputs that matter

    Three required string inputs:

    • input_directory - the folder you're zipping up.
    • output_directory - where the finished .zip gets written.
    • zip_filename (default archive.zip) - the base filename; expect a timestamp appended automatically if that name is already taken at the destination.

    One output: zip_path (STRING) - the full path to the file it just wrote. Since is_output_node is true you don't have to wire this anywhere for the node to do its job, but it's there if you want to pass the path along - into FL_ShowText to confirm it on-screen, or into a notification step.

    How to install it

    Via ComfyUI Manager: search ComfyUI_Fill-Nodes (or Fill-Nodes), install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
    

    Restart ComfyUI. Same as its in-memory sibling, this is plain zipfile from the standard library - no extra dependencies, no model downloads.

    Common issues & troubleshooting

    Output directory doesn't exist yet. The README doesn't spell out whether this node creates the destination folder for you the way some of the other Fill-Nodes save nodes do - if you hit a "no such directory" error, the safe move is to just create output_directory yourself before running, rather than assume it'll appear automatically.

    You expected an overwrite and got a new file instead. That's the collision handling working as designed - if you keep re-running the same workflow against the same output_directory and zip_filename, you'll accumulate timestamp-suffixed archives instead of one file being replaced each time. Clean out old archives yourself if you don't want them piling up.

    Large source directories are slow and produce big files. Same caution as FL_ZipDirectory - pointing this at a folder full of large model checkpoints or a big video dataset means real disk I/O and real time, not an instant operation. It's built for bundling things like finished datasets or output batches, not for archiving your whole models folder.

    Wrong node for feeding a downstream uploader. If the next step in your graph is something that wants raw zip bytes rather than a file path - an API upload node, for instance - you probably want FL_ZipDirectory instead, since this node's whole point is writing to disk rather than staying in memory.

    Category🏵️Fill Nodes/File Operations

    Inputs (3)

    NameTypeDefaultDescription
    input_directorySTRING
    output_directorySTRING
    zip_filenameSTRINGarchive.zip

    Outputs (1)

    NameTypeDescription
    zip_pathSTRING