Binary File Saver
The pack's general-purpose 'write bytes to disk'
- Binary Data
- Saved Path
Every pack needs a way to get data back out of the graph, and this is comfyui-dci's Swiss-army saver. Binary File Saver takes any BINARY_DATA and writes it to disk at a path you control - with prefix/suffix filename mangling and overwrite protection thrown in. It's the counterpart to the Binary File Loader: whatever bytes you loaded or generated, this is how you persist them.
The write is plain Python file I/O - no format knowledge, no validation. If you hand it a DCI archive, you get a .dci on disk. Hand it base64-decoded bytes of an image, you get an image file. It doesn't care, and that's the feature.
Required inputs:
- Binary Data - the bytes to save.
- File Name - default
binary_file. This is smarter than it looks: it accepts a full path and strips it down to the basename, soC:\Users\you\icons\logo.pngbecomes justlogo.png. You can't escape the output directory with this - think of it as a name, not a path.
Optional inputs:
- Output Directory - leave blank and it writes to ComfyUI's default output folder. Set it and the directory is created for you if it doesn't exist.
- Filename Prefix / Filename Suffix - prepended/appended to the final name. Great for batch runs where you want
final_logo.png,draft_logo.png, etc. - Remove Extension - strips the extension from the source name before adding prefix/suffix. Handles compound extensions like
.tar.gztoo. - allow_overwrite - defaults to off, which means the node refuses to clobber an existing file and returns an error string instead. Flip it on if you genuinely want overwrites.
Output: Saved Path - the full path the file landed at, so you can log it, pass it onward, or display it. Being an output node, it also surfaces the result in the UI.
Installing
Part of comfyui-dci - Pillow and numpy, nothing heavier:
cd ComfyUI/custom_nodes
git clone https://github.com/zccrs/comfyui-dci
cd comfyui-dci && pip install -r requirements.txt
Or ComfyUI Manager → search "DCI Image Export Extension" → install → restart. Node is under DCI / Files.
Where people get burned
- The error messages look scary but are just messages. When something's wrong - empty data, existing file with overwrite off, bad type - the node returns an error string as the Saved Path rather than throwing. Read it; it's usually telling you exactly what to fix.
File Nameis a name, not a path. The output directory is a separate field for a reason. Trying to smuggle a path in the filename gets it stripped to the basename.- Overwrite is off by default, which surprises people the first time a second run "fails." That's a feature, not a bug - you've been warned.
If you want the DCI-aware variant that auto-renames things to .dci, that's the sibling DCI File Saver node. This one is the raw, general-purpose writer - use it for anything that's not specifically a DCI file.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| Binary Data | BINARY_DATA | — | |
| File Name | STRING | binary_file | — |
| Output Directoryopt | STRING | — | |
| Filename Prefixopt | STRING | — | |
| Filename Suffixopt | STRING | — | |
| Remove Extensionopt | BOOLEAN | false | — |
| allow_overwriteopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Saved Path | STRING | — |