π PD Switch
A/B two models (or two prompts) without rewiring your whole graph
- input_1
- input_2
- input_3
- input_4
- input_5
- input_6
- input_7
- input_8
- output
The classic way to compare two checkpoints or two prompts in ComfyUI is to build the whole pipeline twice and flip between them by dragging wires. It works; it's also how you delete the wrong wire and silently render with the wrong model. π PD Switch is the tidy alternative: it routes one of up to eight inputs to a single output, and the inputs are wildcard (*), so it works on models, prompts, latents, seeds, samplers - anything. You wire both candidates in and flip a single widget to choose which one flows through.
How it works
Two selection modes, one widget apart:
mode=manual- you pick with theselectwidget (0β7). This is the everyday mode: set up both inputs, flipselectto swap, re-queue.mode=value- the selection comes from theindexinput pin instead of a widget. Wire a number into it and the node routes dynamically, which is how you'd drive the switch from another node or an iteration loop.
The selected value appears on the single output output, same type as whatever you connected. The index is clamped to 0β7, so an out-of-range value just selects the last input instead of erroring - safe, if slightly forgiving.
The slick part is the input slots: the pack's JS extension auto-grows the list as you connect more inputs (2 to 8) and trims empty ones. You don't configure how many channels exist; you just keep plugging things in. It's the rare node that gets less confusing the more you use it.
The inputs that matter
mode-manualorvalue; the one setting you'll touch per workflow.select- the manual index (0β7).index- the value-mode index input.input_1β¦input_8- the wildcard candidates. Only connect what you use; the JS keeps the rest out of your way.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/TheOnlyAaron/comfyui-pipedream
Restart ComfyUI, or install "Pipedream" via ComfyUI Manager. No dependencies, no models to download.
Gotchas
selectis zero-indexed - input_1 is select 0, input_2 is select 1, and so on. The most common mistake is flipping to 1 expecting the second input and getting the third.- The wildcard output means ComfyUI can't type-check what you plug in. A mismatch shows up at execution time, not at connection time. That's the price of routing anything.
- The node only routes - it doesn't remember or batch. If you want to run both candidates automatically, that's a job for π PD Wedge iterating over the selection, or just queue twice.
- For the A/B-compare pattern specifically, pair it with a fixed seed: lock everything else, flip the switch, and the only thing that changes is what you're testing. That's the whole discipline, automated.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | 2 options: manual, value | |
| select | INT | 00β7 | β |
| indexopt | INT | 00β7 | β |
| input_1opt | * | β | |
| input_2opt | * | β | |
| input_3opt | * | β | |
| input_4opt | * | β | |
| input_5opt | * | β | |
| input_6opt | * | β | |
| input_7opt | * | β | |
| input_8opt | * | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | β |