đź’€Prepack Int Combine
Turn up to four numbers into one string, cleanly — the glue your filenames need
- combined
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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| int1 | INT | 0-2147483647–2147483647 | First integer value to combine. |
| int2 | INT | 0-2147483647–2147483647 | Second integer value to combine. |
| int3opt | INT | 0-2147483647–2147483647 | Third integer value to combine (optional). |
| int4opt | INT | 0-2147483647–2147483647 | Fourth integer value to combine (optional). |
| separatoropt | COMBO | Comma | Separator to use between the integers. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| combined | STRING | Combined string with up to four integers separated by the chosen separator. |