Nodes/ComfyMath/ComposeVec2
ComfyUI Node

ComposeVec2

Bundle two floats into one VEC2 wire

By evanspearman·Created 3 years ago·Updated about a year ago· 192
ComposeVec2
    • VEC2
    x0.00
    y0.00

    ComposeVec2 does the opposite of BreakoutVec2: it takes two separate FLOAT values - an x and a y, a width and a height, whatever pair you're tracking - and packs them into a single VEC2 output. The reason to bother is tidiness. If you've got two related values that need to travel together through several nodes downstream, sending them as one VEC2 wire instead of two parallel FLOAT wires keeps your graph readable, the same instinct behind rgthree-comfy's Context nodes bundling several connections into one - just applied here to a plain pair of numbers instead of a whole bundle of node connections.

    How it works

    Feed x and y (both FLOAT, default 0) in, get a single VEC2 out containing both, in that order.

    The inputs and outputs that matter

    • x, y - the two float values to bundle.
    • Output - a single VEC2, feeding into BreakoutVec2 later, or directly into any other ComfyMath node that expects a VEC2 input.

    Installing it

    ComfyUI Manager: search ComfyMath, install, restart. Manually:

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

    then restart. Pure Python, no extra dependencies, no models.

    Common issues

    The main thing to know before reaching for this: VEC2 is a type ComfyMath defines for its own use, and outside of this pack's own nodes almost nothing else in the ecosystem natively produces or consumes it. That means composing a VEC2 is mostly useful when you're staying inside ComfyMath's own vector-math tooling, or bundling two values purely for tidiness before splitting them apart again with BreakoutVec2 further down the same graph. It's not a general-purpose "coordinate" type that plugs into other packs' width/height, position, or crop-box inputs - check whether the destination actually wants a VEC2 before assuming this is the right way to combine two numbers.

    If your actual goal is doing math on a pair of numbers rather than just packaging them for tidiness, remember this node doesn't compute anything - it's pure packaging. If you want vector arithmetic (adding two VEC2s together, say), that's a separate operation this particular node list doesn't include; this one and BreakoutVec2 are the pack/unpack pair, not the math.

    Being one of the least-used nodes in an already small, quiet pack, this one has essentially no community discussion to draw on. ComfyMath hasn't had active maintenance since roughly early 2024 by community accounts, but there's little here for an upstream ComfyUI change to break - it's two floats going into a tuple, nothing more.

    Categorymath/conversion

    Inputs (2)

    NameTypeDefaultDescription
    xFLOAT0.00
    yFLOAT0.00

    Outputs (1)

    NameTypeDescription
    VEC2VEC2