Nodes/ComfyUI-ArchiGraph/Nparray Save πŸ¦β€πŸ”₯
ComfyUI Node

Nparray Save πŸ¦β€πŸ”₯

Save your numpy arrays to disk β€” the cache node that makes expensive preprocessing optional

By vincentfsΒ·Created 2 years agoΒ·Updated 9 months agoΒ· 3
Nparray Save πŸ¦β€πŸ”₯
  • nparray
  • file_path
β—„filename_noExtunknownβ–Ί

The ArchiGraph pack turns your images into numpy arrays the moment they hit an OpenCV node, and once that's happened the only way to keep a result between sessions is to write it to disk. That's exactly what this node is for. It takes a NPARRAY - the pack's custom type for numpy arrays - and writes it to a .npy file in ComfyUI/output/nparrays/. If you've ever rebuilt a workflow and silently cursed having to re-run a slow preprocessing pass to get back the mask you tuned by hand, this is the node that ends that.

Why you'd reach for it

In a floor-plan or architectural pipeline - which is what this pack is aimed at - you often run expensive image processing (Sobel, contour finding, connected components) over a big batch, and the intermediate arrays are worth more than the final PNG. Nparray Save lets you cache them. Pair it with the pack's AG Nparray Load node on the next run and you can skip straight to the analysis. It's also a tidy way to hand an array to a numpy-aware tool outside ComfyUI.

How it works

Under the hood it's just numpy.save(). The node takes your array, joins output/nparrays/ with your chosen name, appends the .npy extension, and writes the file. Because .npy preserves the array exactly - dtype, shape, the lot - what comes back out of AG Nparray Load is bit-for-bit what you put in. No float-to-8-bit rounding, no channel reordering, nothing lost.

The inputs that matter

Only two, and only one you'll actually touch:

  • nparray - the array to save. Any dtype, any shape; the node doesn't care.
  • filename_noExt - filename without extension. The default is "unknown", which means you will get unknown.npy if you forget to change it. Give it a real name.

The single output is file_path, a STRING with the absolute path of the file you just wrote. You can wire that into a text-display node or log it, though most people just leave it dangling since this is an output node.

Installing it

Nparray Save ships in the ComfyUI-ArchiGraph pack. Easiest path: ComfyUI Manager β†’ search "ArchiGraph" β†’ install β†’ restart ComfyUI. Or do it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/vincentfs/ComfyUI-ArchiGraph
cd ComfyUI-ArchiGraph
pip install -r requirements.txt   # or run install.bat / install.sh on Windows

The pack pulls in opencv-python, opencv-contrib-python, matplotlib, and numba - no models, no API keys, all CPU-side. The first install can take a couple of minutes because opencv-contrib is a chunky wheel, but it's a one-time thing.

Where people get burned

The two real traps are boring ones. First, the files live in output/nparrays/, not the output root - go looking in the wrong folder and you'll swear the save failed. Second, nothing ever cleans up after you. Every unique filename_noExt you use is a permanent .npy sitting in that folder, and a handful of sessions of fiddling will quietly eat a few hundred megabytes. Nuke the folder when you're done experimenting.

Also worth knowing: NPARRAY is a type that only this pack recognizes. A saved .npy is perfectly standard and loadable with plain numpy, but in the graph it only wires back into ArchiGraph nodes - to see it as an image, route it through AG To Image first.

CategoryπŸ¦β€πŸ”₯ ArchiGraph/πŸ› οΈ Utils

Inputs (2)

NameTypeDefaultDescription
nparrayNPARRAYβ€”
filename_noExtSTRINGunknownFilename without extension (extension .npy will be added automatically).

Outputs (1)

NameTypeDescription
file_pathSTRINGβ€”