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

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

Bring a saved numpy array back into the OpenCV world

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

    This pack's OpenCV nodes don't operate on ComfyUI IMAGE tensors - they work on raw numpy arrays in a custom NPARRAY type. When you want to reuse a previously detected or processed array without re-running the whole pipeline, that's what this node is for: it loads a .npy file back into the graph as an NPARRAY, ready for the next OpenCV node.

    How it works

    The node lists every .npy file in ComfyUI/output/nparrays and presents them in the npyfile dropdown. Pick one and the array comes out the nparray output as an NPARRAY, exactly the type the pack's OpenCV nodes consume - Canny, Hough, threshold, contours, the lot. No conversion, no To Nparray detour.

    Then there's the override: type a name into filename_noExt (extension .npy added automatically) and it ignores the dropdown and loads that file instead. That's your path for loading a file that was just written and hasn't refreshed into the dropdown, or for scripting runs where the filename changes per batch item - pair it with the iterate nodes and you can load a different array on every pass.

    The workflow it belongs to

    The pack's OpenCV pipeline is: IMAGE β†’ To Nparray β†’ [process] β†’ To Image. If your processed result is worth keeping, save it with the pack's Nparray Save node. Next session, this node reloads it in one step - no re-running the detection. For folder-batch work it's even better: Nparray Load (via filename_noExt) + Iterate Generator walks a folder of .npy files, letting you re-process previously computed arrays in bulk.

    Install

    ComfyUI Manager β†’ search ComfyUI-ArchiGraph, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/vincentfs/ComfyUI-ArchiGraph
    

    Restart and run the pack's install script once. Numpy comes with ComfyUI anyway - nothing extra downloads.

    Gotchas

    • Files live in output/nparrays, not your input directory. The .npy files you saved yourself are what the dropdown lists; there's no file browser for elsewhere on disk.
    • If that folder is empty, the dropdown shows a single "None" entry and the node raises FileNotFoundError on execute.
    • The tooltip's "If specified, npyfile will be ignored" is the standard override pattern in this pack - same deal as JSON Load, just for arrays.

    A loader, plain and simple, but it's the key to making OpenCV-style work in this pack repeatable. Save once, load forever.

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

    Inputs (2)

    NameTypeDefaultDescription
    npyfileCOMBO1 options: None
    filename_noExtSTRINGFilename without extension (extension .npy will be added automatically). If specified, npyfile will be ignored.

    Outputs (1)

    NameTypeDescription
    nparrayNPARRAYβ€”