TOO INT Swap
A one-checkbox A/B switch for integers
- a
- b
TOO INT Swap is about as simple as a ComfyUI node gets: two integer inputs, two integer outputs, and a boolean that crosses the wires. Leave swap unchecked and it's a straight pass-through - a goes to a, b goes to b. Check it and the outputs swap, so you get b where a came in and vice versa.
Why would you want that? It's an A/B switch for numbers, and A/B switches exist to let you keep two values in one workflow and flip between them without deleting anything. The classic use is seeds. You find two seeds you like, wire both into this node, and one checkbox decides which one your KSampler sees - handy for A/B testing a single idea across two seeds, or for any workflow where you want to compare two step counts, two CFG values, or two batch sizes without editing widgets mid-run.
How it works. There's no real mechanism to explain - the source is a three-line function that returns (b, a) when swap is true and (a, b) otherwise. That's it. The useful part is where it sits in the graph: it's the primitive, typed version of the pack's TOO Any Swap. If your values are integers, this one keeps the type tight and the sockets honest. If you're swapping models, images, or conditionings, use Any Swap instead - that one accepts anything via the wildcard * type.
Inputs and outputs. Required: a and b (both INT, full 64-bit range) plus swap (BOOLEAN, default false). Outputs: a and b, again integers. There's nothing optional and nothing hidden - a beginner could wire this blind.
Install. Same story as every node in this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/tetsuoo-online/Comfyui-TOO-Pack
or install "Comfyui-TOO-Pack" from ComfyUI Manager, then restart. No dependencies beyond what ComfyUI already ships.
Where people get confused. The swap toggle is a state, not an action - you check it to swap, and if you want to swap back you uncheck it. It won't flip itself per run, so don't reach for it as a toggler unless you're driving the boolean from somewhere else. If you're looking for the more general routing pattern (pick first non-null input, or route many inputs by index), this node is the wrong shape - it's strictly the two-input, one-checkbox flavor. It's a plumbing node in the most literal sense: nothing to tune, everything to wire.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| a | INT | 0-9223372036854776000β9223372036854776000 | β |
| b | INT | 0-9223372036854776000β9223372036854776000 | β |
| swap | BOOLEAN | false | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| a | INT | β |
| b | INT | β |