Nodes/ComfyUI-Apt_Preset/type_SubConvert
ComfyUI Node

type_SubConvert

One input, three typed outputs — the pocket converter

By cardenluo·Created 2 years ago·Updated 22 days ago· 309
type_SubConvert
    • int
    • float
    • text
    int_in
    float_in
    text_in

    type_SubConvert is the converter you didn't know you needed until a FLOAT socket rejected your integer. It takes one of three typed inputs - int_in, float_in, text_in - and gives you all three back as outputs: int, float, and text. Plug in whichever type you have, and every typed socket downstream has something to grab. It's the "give me all types from any type" node that every workflow eventually needs, and it's one of the rare ones that does it in a single small node.

    The workflow problem it solves is ComfyUI's type rigidity. Widgets hand you ints, model specs want floats, text fields want strings, and wires will happily refuse a mismatched type even when the value is obviously fine. Most people solve this with a forest of conversion nodes or by digging through a big utility suite. This node collapses that to one socket in and three out.

    How it works

    Whatever you feed in gets converted across all three representations, and all three outputs are live regardless of which input you used. Feed int_in a 5 and you get int=5, float=5.0, text="5". Feed text_in "3.25" and you get float=3.25 and int=3. Because the outputs are all emitted at once, you can wire one type_SubConvert to three different consumers instead of stacking three converters in series.

    The inputs and outputs that matter

    The three optional inputs are mutually exclusive in practice - you connect one:

    • int_in (INT) - a whole number, e.g. from a steps or seed widget.
    • float_in (FLOAT) - a decimal, e.g. from a denoise or CFG slider.
    • text_in (STRING) - a string, e.g. from a prompt or text field.

    The outputs are int, float, and text. Grab whichever one the next node demands.

    How to install it

    It ships in the ComfyUI-Apt_Preset pack. Install the pack once via ComfyUI Manager (search "ComfyUI-Apt_Preset") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
    

    then run install.bat (Windows) or pip install -r requirements.txt, and restart ComfyUI. No models, no extra downloads - this node is pure data plumbing.

    Common issues & troubleshooting

    The one trap: text-to-number only works when the text actually parses. Feed text_in the string "one hundred" and the numeric outputs won't magically be 100. Feed it digits and you're fine. If you're feeding a number that came out of a FLOAT widget via a string bridge, check for formatting artifacts - a comma or a trailing newline will break the parse.

    Pack-level, the usual caveat applies. This is a small, niche pack by a Bilibili-based author; the README is translated and node names are terse. If the node doesn't show up, the pack's dependencies weren't installed - the community's most common report is an IMPORT FAILED for the whole pack, which is the install.bat step you can't skip. Run it, restart, and this little converter will be there.

    CategoryApt_Preset/data

    Inputs (3)

    NameTypeDefaultDescription
    int_inoptINT
    float_inoptFLOAT
    text_inoptSTRING

    Outputs (3)

    NameTypeDescription
    intINT
    floatFLOAT
    textSTRING