Flood Gate
Flip between two workflows with one click, no rewiring
- source
- CLOSE
- OPEN
You know the ritual. You run base resolution a bunch of times hunting for a good seed, and only when one lands do you want the full Hires fix / upscale pass to kick in. In most ComfyUI graphs that means disconnecting nodes, dragging new ones in, and reconnecting - every single time. Flood Gate exists to kill that dance. It's a data-flow switch: one source in, two outputs out, and a little boolean toggle that decides which path actually runs. No rewiring, no deleting, one click.
The name isn't a lie about scope - this is a tiny node - but the mechanism behind it is sneakier than it looks, and it's worth understanding before you build a workflow on top of it.
What it actually does
Wire the output of whatever node you're branching from (a LATENT, an image, a conditioning, anything) into source. Then connect the CLOSE output to your "draft quality" path and the OPEN output to your "final quality" path. Flick gate_open and re-queue: only the matching branch runs. Because ComfyUI caches intermediate results, opening the gate doesn't re-run the nodes upstream of it - you keep your seed-testing speed and only pay for the expensive pass when you actually want it. It was built with Hires fix in mind, but it's generic: generate-a-bunch-then-upscale-later, two different prompt routes off the same base, A/B a low-step and high-step sampler, whatever.
How the trick works
Here's the part that surprises people. The node's own gate() function is a one-liner - it literally returns (source, source), passing the same value to both outputs. The actual gate is in the pack's __init__.py, which monkeypatches ComfyUI's prompt validator. When you queue, it walks the graph, finds every node fed by the output that should be blocked, and deletes those nodes from the prompt - then recursively deletes everything downstream of them. The blocked branch simply isn't part of the graph that executes. That's also the correct reading of the README's warning: the logic is parsed at queue time, not execution time.
The inputs that matter
There are exactly two, and a beginner only really touches gate_open:
source- any type (the wildcard*). Whatever you want to branch.gate_open- the boolean switch, defaultfalse.falseruns the CLOSE path,trueruns the OPEN path.
Outputs are CLOSE and OPEN, both the same type as your source. Note the type caveat in the README: source type and the downstream node's input type still have to match - this is a flow switcher, not a converter.
Where people get burned
The big one: the boolean has to be decided when you press Queue Prompt. It can be the widget itself or a primitive node - not a node that computes a boolean mid-execution. Feed it a runtime-computed value and you'll get a "Floodgate Unable to Determine Boolean" error telling you exactly that. Second gotcha: if the branch types don't line up you get a "Floodgate IO Type Mismatch" - both inputs you're branching into need to accept the same type. Multiple gates in one workflow are fine and each toggles independently, so don't be shy about using more than one.
Install
It's on ComfyUI Manager - search Floodgate and install. Or the old-fashioned way:
cd ComfyUI/custom_nodes
git clone https://github.com/Haoming02/comfyui-floodgate
Then restart ComfyUI. No model downloads, and the pyproject declares zero dependencies - it's pure Python that leans on ComfyUI's own internals. It comes from Haoming02, the same single maintainer who later kept Forge alive with Forge Classic/Neo, and this pack has the same "does one thing, doesn't break" energy. For a one-node utility it's been quietly reliable for years. If you live in Hires-fix land, it's worth the thirty seconds to install.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| source | * | — | |
| gate_open | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| CLOSE | * | — |
| OPEN | * | — |