AC_Switch开关
Flip between two prompts without rewiring anything
- Prompt
Every so often you want to run the same setup with two different prompts - one positive, one alternative; or a daytime and a nighttime version of the same scene. The tedious way is to bypass and re-enable nodes between runs. The ComfyUI-AC_FUNV2.0 pack's answer is AC_Switch开关, a two-position A/B selector that picks between two strings and hands the winner to whatever's downstream.
It's about as simple as a node gets. There's a Switch dropdown with One and Two, plus two inputs, Prompt_1 and Prompt_2. Flip the dropdown to One and the node returns Prompt_1; flip it to Two and it returns Prompt_2. One STRING output named Prompt comes out the other side, and you wire that into your CLIP Text Encode (or into another node in the pack, like a season prompt reader or the Panel display).
Where people get tripped up:
- Both prompt inputs are
forceInputsockets, not text boxes. You can't type into them - you have to wire strings in from upstream nodes. Leave one unconnected and the graph errors out on validation. If you want to switch between a season prompt and a hand-written one, wire them both in and you're done. - This is a string-only switch. It routes text and nothing else. If you're picturing the any-type switches from rgthree's pack - the ones that swap whole models or latents - this isn't that. Its sockets are declared
STRING, so it won't accept anIMAGEor aMODELand it can't. For a prompt-only A/B that's fine; for anything heavier you want a real polymorphic switch. - The
Switchwidget is manual. There's no randomize, no input socket driving it - you click One or Two. If you want to script the choice from elsewhere in the graph, this isn't the tool.
Why you'd bother when you could just keep two text nodes around? Because the switch keeps both prompts live in the graph at once, and you can leave them parked there while you experiment with everything else. It's exactly the "graph as a small program" pattern the plumbing layer is built for: a routing valve you flip instead of reconnecting wires, which means it also survives being saved into a workflow and shared - the switch state travels with the JSON.
Install is the standard one for this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/A719689614/ComfyUI-AC_FUNV2.0
restart, and it's under ♑AC_FUNV2.0. No models, no dependencies beyond stock ComfyUI (again, if requirements.txt's torch==2.11.0 pin nags you, skip that line).
A note on the name: it's "AC_Switch开关" - the trailing characters mean "switch" in Chinese, the author's naming convention throughout the pack. Don't go hunting for an English-named node; search "AC_Switch" in the node menu and it'll be there. And if you find yourself chaining two of these to pick between three prompts, you're building a mux the hard way - a single three-way switch would be easier, but for the common two-prompt case this does the job without drama.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| Switch | COMBO | 2 options: One, Two | |
| Prompt_1 | STRING | — | |
| Prompt_2 | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Prompt | STRING | — |