Nodes/ComfyUI Prepack/đź’€Prepack Int Combine
ComfyUI Node

đź’€Prepack Int Combine

Turn up to four numbers into one string, cleanly — the glue your filenames need

By S4MUEL-404·Created 12 months ago·Updated 10 months ago· 2
đź’€Prepack Int Combine
    • combined
    â—„int10â–ş
    â—„int20â–ş
    â—„int30â–ş
    â—„int40â–ş
    â—„separatorCommaâ–ş

    ComfyUI is full of moments where you have the right numbers but the wrong shape: you've got a width, a height, and a seed as separate integer wires, and the node you're feeding wants them in a single string like 1024,1024,5847332. The đź’€Prepack Int Combine is the two-second fix - it takes up to four integers and joins them into one string with a separator you pick.

    It's a boring node, and that's the compliment. The utility nodes that keep your workflow from needing a dozen converters are the ones you stop noticing after a while, and this is exactly that kind.

    How it works

    Two integers are required (int1, int2), two more are optional (int3, int4) - if you don't wire the optional ones they're skipped entirely, not padded. The separator dropdown is where the flexibility lives, and it covers the cases you'll actually hit:

    • Comma → 1024,1024,42
    • Semicolon → 1024;1024;42
    • Space → 1024 1024 42
    • Newline → one number per line
    • Forward Slash → 1024/1024/42

    Under the hood it's a simple join: each int is converted to its string form and glued with the separator character. No rounding, no formatting, no cleverness - what you put in is what comes out as a STRING.

    The single output, combined, wires into anything that wants a string: a filename-building save node, a text display, a prompt template, or the input of this pack's own Int Split node when you need to round-trip. The classic use is building filenames - width + height + seed joined with an underscore (well, comma - you get the idea) into something like a save node's name field, so every output file is self-describing.

    Where people get burned

    The separator is a dropdown, not a text field - you can't type a custom separator like _. If you need underscores you'll use Comma, Space, or a quick string-replace node downstream. And since int3/int4 are skipped when unwired, a workflow that sometimes feeds them and sometimes doesn't will produce different string lengths - which is usually fine, but if you're joining exactly four values for something like a fixed-format parameter, wire all four or leave the optional ones unwired permanently.

    Also worth knowing: the inputs are strictly INT. If you're holding a float (like a step count stored as 20.5), it won't accept the wire - run it through a float-to-int converter first.

    Installing it

    It ships in the Prepack pack, so it comes down with the whole thing:

    cd ComfyUI/custom_nodes
    git clone https://github.com/S4MUEL-404/ComfyUI-Prepack.git
    pip install -r ComfyUI-Prepack/requirements.txt
    

    Or search "Prepack" in ComfyUI Manager. Dependencies are PyTorch, NumPy, and Pillow - already in a stock install. Restart ComfyUI, find it under đź’€Prepack. No models, no extra setup.

    If the output string looks wrong, check the separator dropdown first - it defaults to Comma, and it's the most common reason a joined string doesn't match what you expected. Everything else about this node is hard to get wrong, which is the point.

    Categoryđź’€Prepack

    Inputs (5)

    NameTypeDefaultDescription
    int1INT0-2147483647–2147483647First integer value to combine.
    int2INT0-2147483647–2147483647Second integer value to combine.
    int3optINT0-2147483647–2147483647Third integer value to combine (optional).
    int4optINT0-2147483647–2147483647Fourth integer value to combine (optional).
    separatoroptCOMBOCommaSeparator to use between the integers.

    Outputs (1)

    NameTypeDescription
    combinedSTRINGCombined string with up to four integers separated by the chosen separator.