Nodes/ComfyUI-aihub-workflow-exposer/AIHub Utils Str To Vector
ComfyUI Node

AIHub Utils Str To Vector

Turn \"1.5,2.5,3.5\" Into Real Numbers — AIHub Utils Str To Vector

By otavanopisto·Created about a year ago·Updated 22 days ago· 7
AIHub Utils Str To Vector
    • FLOAT_X
    • FLOAT_Y
    • FLOAT_Z
    value0.0,0.0,0.0

    AIHub Utils Str To Vector is the smallest node in the AIHub pack and proud of it: one string goes in, three floats come out. You feed it "1920,1080" and you get 1920.0 and 1080.0 (plus a spare 0.0). That's the whole job.

    You'll almost never reach for this node by itself. It earns its keep inside the AIHub ecosystem, where values arrive from the connected client app (a GIMP-style editor, for instance) as strings. AIHub Expose String Selection hands you a comma-separated text value, and this node is how you turn that into actual numbers the rest of your graph can sample with. The README's example is the classic case: a string selector for video resolution - "landscape" or "portrait" - feeding 1920,1080 or 1080,1920 into this node, which then splits it into usable width and height floats.

    How it works

    The mechanism is dead simple and it's right in the source: the string is split on commas, whitespace is stripped, and each piece is cast with Python's float(). The node then pads or truncates to three values:

    • 3+ numbers → the first three are kept
    • 2 numbers → FLOAT_Z gets 0.0
    • 1 number → both FLOAT_Y and FLOAT_Z get 0.0

    So it never errors on a short input - it quietly zero-pads. It will error on something it can't parse, like "0.5,a,2", with a ValueError telling you exactly what it couldn't convert. Fix the string, not the node.

    The one input that matters

    The info_schema gives you exactly one field, and you'll probably leave it alone at first:

    • value (STRING, default "0.0,0.0,0.0") - the comma-separated string to convert. You'll normally wire this from an AIHub expose or a string widget rather than typing it in.

    The three outputs, in order, are FLOAT_X, FLOAT_Y, and FLOAT_Z - plain FLOAT values you can wire into any input that wants a number, like a width/height pair for a latent or image node. If the AIHub pack's other utils are the hammers, this one's the screwdriver: AIHubUtilsStrToFloat does the same trick for a single value, and this is just the three-axis version. The README's own guidance is that these utils exist because the expose layer moves data as strings, and occasionally you need it back as numbers.

    Installing and using it

    It ships as part of the whole AIHub pack, so you're not installing this alone. Either search for "ComfyUI-aihub-workflow-exposer" in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/otavanopisto/ComfyUI-aihub-workflow-exposer
    

    Then restart ComfyUI. There's no requirements.txt - the pack deliberately uses only what ComfyUI already ships, so no pip install and no model downloads. It does expect the ComfyUI/aihub/ folder structure (workflows, models, loras) to exist for the rest of the pack; a plain utility like this works regardless.

    Honest take: if you're not building an exposed AIHub workflow - one meant to be driven by an external editor through the websocket server - you don't need this node. Within that context, though, it's the boring, reliable glue between a string selector and a resolution-hungry sampler.

    Categoryaihub/utils

    Inputs (1)

    NameTypeDefaultDescription
    valueSTRING0.0,0.0,0.0The comma separated string to convert to a vector of floats

    Outputs (3)

    NameTypeDescription
    FLOAT_XFLOAT
    FLOAT_YFLOAT
    FLOAT_ZFLOAT