Nodes/ComfyUI_MieNodes/Save Any ๐Ÿ‘
ComfyUI Node

Save Any ๐Ÿ‘

Dump whatever's on the wire straight to disk

By MieMieeeeeยทCreated 2 years agoยทUpdated 28 days agoยท 225
Save Any ๐Ÿ‘
  • value
    โ—„file_pathoutput/cache/foo.pklโ–บ

    This is about as minimal as a save node gets: one input for whatever value you want to persist, one input for where to put it, no format options, no configuration. Wire anything into value, give it a file_path, and it writes it to disk. The default path - output/cache/foo.pkl - is the real clue to what's going on under the hood: this is pickling arbitrary Python objects, not exporting a clean, human-readable file.

    What it's actually for. Not every ComfyUI value is an image or a string you'd want to look at in a text editor - latents, embeddings, a batch of tensors, a whole object graph from a custom node's output. Save Any is a generic escape hatch for caching exactly that: the current state of something expensive to recompute, so a later run (or a different workflow) can load it back instead of regenerating it from scratch. It's a terminal node - is_output_node is set on it, and it has no outputs of its own, so it's meant to sit at the end of a branch, not feed anything downstream.

    The two things you set.

    • value (required, accepts anything - * type) - whatever you're saving. No validation on what this actually is; the node's job is to serialize it, not to understand it.
    • file_path (default output/cache/foo.pkl) - where it lands. The .pkl extension in the default is the tell that this is Python's pickle format under the hood rather than JSON or plain text, which matters because pickle can represent almost any Python object but isn't portable outside Python and isn't something to open in a browser or a text editor expecting to read it.

    Not the same node as the README's Save Anything. Worth being explicit about this: the pack's README does document a node called SaveAnythingAsFile, with directory, file_name, and a save_format choice of JSON, TOML, or TXT. That's a different node with a different schema - this one, SaveAny|Mie, takes a single combined file_path instead of a split directory/filename, has no format choice at all, and isn't mentioned anywhere in the README's text. If you specifically need a human-readable JSON or TOML export, look for SaveAnythingAsFile instead; this node is the leaner, pickle-flavored sibling that the README doesn't cover.

    Installing. ComfyUI Manager: search ComfyUI_MieNodes and install. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/MieMieeeee/ComfyUI-MieNodes, restart ComfyUI. No extra dependencies for this node specifically - pickling is part of the Python standard library.

    Troubleshooting.

    • File doesn't appear where you expected. file_path is almost certainly relative to ComfyUI's working directory, not an absolute path unless you give it one - check where ComfyUI was actually launched from if the file isn't showing up under output/cache/.
    • Directory doesn't exist yet. The default path implies a cache subfolder under output/ - if that folder structure doesn't already exist, create it yourself (or point file_path somewhere that does exist) rather than assuming the node creates arbitrary nested folders on your behalf.
    • File saves fine but nothing else can open it. That's expected - a .pkl file is a Python pickle, readable back into Python with pickle.load(), not something another application (or a different node pack entirely) can parse. If you need portability, this isn't the node for it.
    • Trying to save something and it errors out. Not every Python object is picklable - things holding open file handles, GPU-context-bound objects, or certain C-extension types can fail to serialize. If you hit this, the value itself (not the node) is usually the problem; try saving a simpler upstream value to confirm the node works, then narrow down what's actually unpicklable.
    Category๐Ÿ‘ MieNodes/๐Ÿ‘ Common

    Inputs (2)

    NameTypeDefaultDescription
    value*โ€”
    file_pathSTRINGoutput/cache/foo.pklโ€”

    Outputs (0)

    No outputs