Nodes/ComfyUI-Data-Analysis/Numpy Int Create
ComfyUI Node

Numpy Int Create

Build an int32 array by typing a list

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Numpy Int Create
    • NDARRAY
    data

    Numpy Int Create is how you type numbers into the graph and get a real Numpy array back. You enter a Python list in a multiline field, it becomes an int32 ndarray on an NDARRAY socket - ready for the pack's Numpy and Pandas nodes. It's the integer counterpart to Numpy Float Create, and together they're the "no CSV needed" entry points for the NumPy side of HowToSD's ComfyUI-Data-Analysis pack.

    Where does a node like this earn its keep? Any time your data is small enough to just type. Sample arrays, index lists, test values for a calculation you're debugging - nothing to load, nothing to parse from a file, just [1, 2, 3] and you're moving.

    How it works

    Same two-step recipe as the float version: ast.literal_eval(data) parses your text as a Python literal, then np.array(list_data, dtype=np.int32) builds the array with explicit 32-bit integer precision. Nested lists give you 2D arrays - [[1, 2], [3, 4]] becomes a 2×2 matrix. The literal_eval step means the syntax rules are Python's, not JSON's: single quotes work, trailing commas don't, and anything that isn't a valid literal raises a clear error right here instead of failing mysteriously later.

    One thing to know: values that don't fit int32 or come in as floats (e.g. [1.5, 2.5]) will get cast or error depending on content - [1.5] becomes 1 under numpy's default casting, so feed it integers if you care about values, not truncation.

    Inputs and outputs

    • data (required, STRING, multiline) - a Python integer literal: [1, 2, 3], or nested for 2D.
    • NDARRAY output - the int32 array.

    When you'd use it

    The natural chain is create → inspect → convert: Numpy Int CreateNumpy Show to verify, or → Pandas Create From Numpy to lift the array into a DataFrame. It's also the on-canvas source for integer index arrays you might route through Pandas selection nodes. For anything file-sized, load the CSV instead - this node is for the hand-built stuff.

    Installing it

    Standard pack install. ComfyUI Manager: search "Data analysis", install ComfyUI-Data-Analysis, restart, reload. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/HowToSD/ComfyUI-Data-Analysis
    mv ComfyUI-Data-Analysis data-analysis   # README: examples expect this folder name
    pip install -r data-analysis/requirements.txt
    

    Dependencies: pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml. No GPU, no model files. The PyTorch nodes moved to ComfyUI-Pt-Wrapper in March 2025, keeping this pack CPU-only.

    Gotchas

    • int32, always. Large integers beyond ~2.1 billion overflow; keep values in range.
    • Floats get truncated by numpy casting. [1.9] becomes 1. Type clean integers to avoid surprises.
    • Python literal syntax. [1, 2,] trailing comma fails; single quotes are fine but unnecessary for numbers.
    CategoryData Analysis

    Inputs (1)

    NameTypeDefaultDescription
    dataSTRING

    Outputs (1)

    NameTypeDescription
    NDARRAYNDARRAY