Nodes/ComfyMath/ComposeVec4
ComfyUI Node

ComposeVec4

Bundle four floats into one VEC4 wire

By evanspearman·Created 3 years ago·Updated about a year ago· 192
ComposeVec4
    • VEC4
    x0.00
    y0.00
    z0.00
    w0.00

    ComposeVec4 rounds out ComfyMath's vector-packing set: it takes four separate FLOAT values - x/y/z/w, R/G/B/A, the four corners of a bounding box, whatever quadruple belongs together - and bundles them into a single VEC4 output. Same idea as ComposeVec2/ComposeVec3, just for a group of four: one tidy wire through your graph instead of four parallel FLOAT connections, paired with BreakoutVec4 for unpacking on the other end.

    How it works

    Feed x, y, z, and w (all FLOAT, default 0) in, get a single VEC4 out containing all four, in that order.

    The inputs and outputs that matter

    • x, y, z, w - the four float values to bundle.
    • Output - a single VEC4, feeding into BreakoutVec4 later or any other ComfyMath node that expects VEC4.

    Installing it

    ComfyUI Manager: search ComfyMath, install, restart. Or manually:

    cd ComfyUI/custom_nodes && git clone https://github.com/evanspearman/ComfyMath
    

    then restart. Pure Python, no extra dependencies, no model files.

    Common issues

    Like the rest of the vector family, VEC4 is a type ComfyMath defines for itself - it isn't something ComfyUI's core nodes or most other custom packs natively speak. Composing a VEC4 makes sense while you're staying inside ComfyMath's own tooling (packaging four values to carry them together, then splitting with BreakoutVec4 further down the graph); it's not a general way to build an RGBA color or bounding box for some unrelated pack's node unless you've confirmed that node actually accepts a VEC4 socket, which is uncommon outside this pack.

    This node is packaging only, not math - if you're hoping it does something with the four values beyond bundling them (averaging, scaling, combining with another VEC4), that's outside what ComposeVec4 and BreakoutVec4 do; they're strictly the pack/unpack pair.

    With four inputs to keep straight, the easiest mistake is simply feeding the wrong value into the wrong slot - since x, y, z, and w are all just floats with no type distinguishing them, a mixup here won't error, it'll just quietly produce a VEC4 with its components in the wrong order. Double-check the order matches what whatever's consuming this VEC4 (or breaking it back out) expects.

    This is one of the least-visited nodes in an already quiet pack - essentially no community discussion around ComfyMath's vector nodes specifically, and no active maintenance on the pack overall since roughly early 2024. There's minimal complexity here for anything to actually break.

    Categorymath/conversion

    Inputs (4)

    NameTypeDefaultDescription
    xFLOAT0.00
    yFLOAT0.00
    zFLOAT0.00
    wFLOAT0.00

    Outputs (1)

    NameTypeDescription
    VEC4VEC4