Text Relay
Split a filename out of your caption text so it survives a ZIP round-trip
- filename
- content
Text Relay is the smallest node in this pack and one of the easiest to overlook, but it solves a boring problem that will bite you exactly once. When the pack's Load ZIP node reads a .txt file from an archive, it hands you the text in a filename\ncontent format - the original filename on the first line, the actual text after. If you want the filename and the content as separate things you can wire around, this node does that split for you.
How it works
You give it a text input (or a list of texts). It splits each one at the first newline, then applies a test: does the first line look like a filename? A line ending in .txt, .json, .srt, .vtt, .csv, .md, .log - or containing a path separator (/ or \) - counts. If yes, that line becomes the filename output and everything after becomes content. If no, the whole string goes to content and filename comes out empty.
So my_caption.txt\nA red car on a wet street becomes filename=my_caption.txt, content=A red car on a wet street. Simple, and it's the same convention Save to ZIP uses on the way back out - which is the whole trick: it makes your captions survive a Load → process → Save ZIP round-trip with their names intact, instead of coming back as ComfyUI_ZIP_00042.txt.
Where it earns its keep
The intended loop: Load ZIP gives you TEXT entries in the filename\ncontent shape → Text Relay splits them → you edit or condition on content → wire the results into Save to ZIP, whose text writer recognizes the same first-line-as-filename format and puts the file back under its original name. It's also just a tidy way to feed a list of captions into a batch: the content output is a clean STRING list with none of the filename scaffolding, ready for a prompt encoder.
Both outputs are lists, and the node accepts a list on the way in, so it plays fine in batch graphs. There's nothing to configure - one text input, two outputs.
Installing
Same pack as the rest:
cd ComfyUI/custom_nodes
git clone https://github.com/aixqueen/jayhuang-zip-unpack-images.git
Restart ComfyUI (or ComfyUI Manager → search jayhuang-zip-unpack-images). No models, no dependencies beyond what the pack already pulls in.
Gotchas
If your text genuinely has a first line that ends in a known extension but isn't a filename - say a caption that literally starts with note.txt - the node will treat it as one. That's an edge case, not a bug; the heuristic is deliberately narrow, so plain prose captions never trigger it. And the usual pack caveat applies: it's a small single-commit repo from an author with no community track record, so give it the standard glance before you build a production loop on top of it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| filename | STRING | — |
| content | STRING | — |