ComfyUI Node Runs on cloud

ZIP Add

Build a zip one render at a time, on the wire

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
ZIP Add
  • content
  • zip
  • zip
  • entry_count
namefile
image_format
text_format.html
compression

ZIP Add is the node that lets an archive grow inside the graph instead of in a file manager afterward. Its whole trick is that the zip lives on a wire as a ZIP value: you add something to it, it hands back a new archive holding what it had plus what you added, and you can chain that - another ZIP Add, then Save ZIP at the end to write the file. No temp folder, no intermediate files, no unzip-and-rezip dance.

When would you want this? When you're producing files in a run and want them bundled at the end - save every frame of an animation batch, or collect a render plus its caption and metadata into one deliverable archive. The wire-based approach means a single workflow can assemble a package that's exactly your renders and notes, and nothing else.

What you can add

The content input accepts IMAGE, MASK, DOC, or STRING. A picture or mask is encoded using image_format: PNG is lossless and keeps alpha, JPEG is smaller but has neither, WEBP splits the difference - smaller than PNG, alpha intact. A string or DOC is written using text_format, where .wasdoc is lossless for the pack's own DOC values, .html writes a whole page, and the other extensions write the text alone.

name is the entry's name, without an extension - the format supplies that. Drop a / in it and you get a folder inside the archive (renders/framerenders/frame_0001.png). A batch numbers each frame after the name. And this is a nice touch: if the archive already holds a name you're adding, the new one is numbered apart rather than replacing the old - nothing gets silently clobbered.

compression is the usual deflate-vs-store choice. Deflate shrinks anything that compresses (text, JSON, HTML); store writes entries as they are, which is the right call for PNGs and JPEGs that are already compressed and would just waste CPU.

Optional in, useful out

The zip input is optional. Leave it unconnected and the archive starts empty - perfect for "this node creates the archive"; wire in an archive from Open ZIP or another ZIP Add and you're appending. Both outputs are worth wiring: zip carries the grown archive onward (next ZIP Add, or Save ZIP to write it to disk), and entry_count is an INT telling you how many files it now holds, which is handy for logging or for driving a condition.

Install

Same home as the rest: WAS Node Suite v3. ComfyUI Manager → search "WAS Node Suite v3", or:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui

Restart. Requires ComfyUI 0.14.0+ / Python 3.10+, and nothing extra is installed - the pack's archive handling is all standard-library zip, always available. The honest caveat for beginners: you probably don't need to zip inside ComfyUI until you're automating batch output. When that day comes - "send me all the frames as one file" - this is the node that makes it one clean wire instead of a cleanup job.

CategoryWAS Suite/Archive

Inputs (6)

NameTypeDefaultDescription
contentIMAGE,MASK,DOC,STRINGWhat to add. An IMAGE or MASK batch writes one file per frame, numbered; a STRING or a DOC writes one file. This socket takes a connection.
nameSTRINGfileEntry name, without an extension, which the format supplies. A '/' makes a folder inside the archive. A batch numbers each frame after this, so 'renders/frame' gives 'renders/frame_0001.png'. A name already in the archive is numbered apart rather than replaced. Eg: renders/frame
image_formatCOMBOHow a picture or a mask is encoded. 'PNG' is lossless and keeps alpha, 'JPEG' is smaller and has neither, 'WEBP' is smaller than PNG and keeps alpha.
text_formatCOMBO.htmlHow a string or a DOC is written, and the extension it gets. '.wasdoc' loses nothing from a DOC, '.html' writes a whole page, and the rest write the text alone.
compressionCOMBO'deflate' shrinks entries that compress; 'store' writes them as they are, which suits pictures that are compressed already.
zipoptZIPThe archive to add to, from Open ZIP or another ZIP Add. Left unconnected, the archive starts empty.

Outputs (2)

NameTypeDescription
zipZIPThe archive holding everything it held before plus what was added. Send it to another ZIP Add, or to Save ZIP to write it.
entry_countINTHow many files the answered archive holds.