ABBA Switch (IMGNR)
The stupid-simple node that swaps Width/Height or Positive/Negative in one click
- any_A
- any_B
- Output 1
- Output 2
The README opens the section with "Not much to it.... just swap any 2 inputs," and for once the author is underselling accurately. ABBA Switch (IMGNR) is a two-input, two-output passthrough that crosses the wires when a toggle is flipped. Feed it your width and height, flip swap_AB_BA to true, and it hands you height and width. That's the whole job.
Boring? Absolutely. But it solves a real workflow annoyance. Width/height, positive/negative conditioning, filename and seed, latent and image - there are plenty of pairs you want to be able to flip without rebuilding a graph or dragging wires around. Drop an ABBA switch on the pair, and A/B testing orientation or swapping a prompt into the negative slot becomes a checkbox you can click mid-run, or even drive with a logic node from somewhere else in the graph.
What's actually under the hood
The inputs are any_A and any_B, both typed as * (wildcard), so they accept anything. The swap_AB_BA boolean does the swap. When it's false, output 1 = A and output 2 = B; when true, they cross.
One thing the wildcard hides, and this is the real gotcha: the Python side enforces that the two inputs are the same type. Connect an INT to a STRING and you get a hard TypeError - "Input types do not match." The * type is permissive at the canvas level precisely so ComfyUI lets you wire anything, but the node then double-checks at runtime. That's a deliberate safety choice, and it'll bite you exactly once before you learn to check your pair types.
The two outputs are named, not unhelpfully, Output 1 and Output 2. There's no type conversion anywhere - what goes in comes out, just possibly on the other wire.
Where it fits
Note what this node is not: it's not an A/B selector. If you want to pick between two alternative values (choose A, choose B, or route from a switch), grab one of the dozens of Switch nodes - rgthree and every utility pack have one. ABBA is specifically for swapping two things that must both stay in the graph, like rotating an aspect ratio. The author's own examples are width/height and positive/negative, and both are spot-on use cases.
Installing it
Standard for the pack, which means zero dependencies and no model downloads:
cd ComfyUI/custom_nodes
git clone https://github.com/ImagineerNL/ComfyUI-IMGNR-Utils
or search "ComfyUI-IMGNR-Utils" in ComfyUI Manager, then restart. It appears under the IMGNR category. It's part of the same utility pack as the preview and catch-and-edit nodes, so you'll get the whole set in one install. If you're on ComfyUI's Nodes 2.0 frontend, the pack author flags that not every feature is verified against it yet - for a node this simple, you're almost certainly fine.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| any_A | * | ANY input (same as B) | |
| any_B | * | ANY input (same as A) | |
| swap_AB_BA | BOOLEAN | false | Swap AB - BA |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Output 1 | * | — |
| Output 2 | * | — |