Load Documents from ZIP
Read a whole archive of documents as one flow
- zip
- documents
- names
- doc
- name
- count
- skipped
Load Documents from ZIP is the batch mode of the pack's document corner: it reads every document inside a zip archive that matches a pattern and puts them on the wire - as one list, and as a per-document stream that runs everything downstream once per document, names included. If Load Document is one report through the graph, this is a folder of reports through the graph, with each one keeping the name it arrived under.
How the archive is read
The file widget lists every .zip in ComfyUI's input, output and temp folders (tagged with where it sits), but you can bypass the menu entirely by wiring the zip socket from Open ZIP - then the archive is opened and indexed once however many nodes read it. The pattern glob picks the entries:
*- every document at any depth.report_*- every document named that way in any folder.drafts/*- a/anchors it at the top of the archive, so this reads one folder.drafts/**/*- that folder and everything under it.
Case is ignored, and only .wasdoc entries are read - the pack's own container format, the same one Save DOC writes.
The doubled outputs
This node's trick is that everything comes out twice, and the two shapes serve different downstream styles:
- Lists -
documentsandnamesas ARRAYs on one wire each, in the same sorted order. Entry 3 indocumentsis the document of name 3 innames. Feed these to Text List Get / Text List Length for logic over the whole set. - Per-document stream -
docis a DOC list andnamea STRING list. Wire either into a downstream node and the graph runs once per document, with the matchingnamealongside - so a conversion or Save DOC can carry the original file name intofilename_prefix. This is the "run the pipeline per file" mode, and it's the one you want for export loops.
Plus count (how many were read - the length of both lists) and skipped (how many entries weren't read). That skipped count is the honesty feature: whatever is not read is counted and named in the log - a non-.wasdoc, an unsafe name, a symlink, an encrypted or damaged or repeated or too-large entry. You get told what got left behind rather than wondering why the count is short.
Failures stop the prompt and say which: an archive that's missing, is a folder, isn't a readable zip, or holds nothing the pattern picks.
Installing it
Part of WAS Node Suite:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
or ComfyUI Manager → "WAS Node Suite v3", then restart. Requires ComfyUI 0.14.0+ and Python 3.10+; v3 installs no pip packages.
Where people trip
Pattern syntax is the first hurdle - remember the / anchors at the archive root, so an unanchored drafts/* reads a drafts folder at any depth rather than only the top one, and ** is what reaches subfolders. Second, only .wasdoc entries are read: zip a folder of .docx and the count comes back 0 with everything on skipped, which looks like a bug until you remember the format gate. Wire the zip socket in when several readers share one archive - it's faster and it stops each node re-opening the file.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| file | COMBO | Which archive to read. The menu lists every .zip in ComfyUI's input, output and temp folders and in any folder added under paths.allow_read, each tagged with where it sits. Ignored while the zip socket is connected. | |
| pattern | STRING | * | Which entries inside the archive to read. '*' takes every document at any depth, and 'report_*' every document named that way in any folder. |
| zipopt | ZIP | The archive to read, from Open ZIP. Connected, it is used and the menu is ignored, so the archive is opened and indexed once however many nodes read it. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| documents | ARRAY | Every document on one wire, in the order the names sort, for Text List Get and Text List Length. Entry 3 here is the document of name 3 in the 'names' output. |
| names | ARRAY | The name each document came from, on one wire and in the same order, such as 'drafts/report.wasdoc'. The folders inside the archive are kept, so two documents of the same name in different folders stay apart. |
| doc | DOC | The same documents as a DOC list, so the graph below runs once per document: wire it into View DOC Metadata, Convert DOC to Plaintext or Save DOC. |
| name | STRING | The file name that goes with each run of the 'doc' output, so a converted or exported copy can carry the name it came in under. Wire it into Save DOC's filename_prefix beside the matching document. |
| count | INT | How many documents were read, which is the length of both lists. |
| skipped | INT | How many entries the archive holds that were not read: one that is not a .wasdoc, one unsafe to unpack, one damaged. The log names every one. |