ꘇ top.switch
A Crossfade You Can Wire to a Signal
- sources
- image
Every workflow eventually needs to pick between two images. ComfyUI core has a switch, rgthree has its Any Switch, and most of the time one of those is fine - this node isn't trying to replace them. What ꘇ top.switch does differently is make the choice itself something you can drive: one float index, up to 64 growing sockets, and a blend that's a real crossfade instead of a jump cut.
That distinction matters because ComfyUI's switch family splits cleanly in two: A/B switches route by a selector, while fallback switches - rgthree's Any Switch is the canonical one - pass the first non-empty input with no selector at all. top.switch is squarely the first kind, but with a selector you can automate.
What it actually does
Two inputs, one growing bank:
- mode -
intorfloat. - index - a float, 0 to 63, step 0.01, default 0. The tooltip is the spec: zero-based index of connected sources, int floors it, float blends adjacent sources, and it clamps to what's available.
- sources - the autogrowing socket bank (source 1…source 64). Empty sockets are skipped, and you need at least one connected or the node errors with "Connect at least one switch source."
Counting is over connected sources in socket order, not over socket positions. So if you wire source 1 and source 3, index 1 is your source-3 image. That one detail is the source of most switch confusion, here and everywhere.
In int mode the index floors and you get one image, pass-through. In float mode you get a crossfade: 1.25 means 75% of source 1 mixed with 25% of source 2. Exactly 1.0 returns source 1 untouched - no resample, no blend.
Under the hood the queued implementation reuses the pack's composite machinery: a cross interpolation on premultiplied alpha, with the alpha divided back out. That's not decoration - blending straight RGBA across a transparency edge is how you get dark halos around cutouts. The second image is resized to match the first, so a 512 source and a 1024 source line up instead of erroring.
In Live mode only the selected source (or the two being blended) is kept on the browser GPU, and - this is the interesting part - a live scalar wire can drive the index. That's the whole reason to pick this node over the core one.
Why you'd reach for this one
Not for a static A/B. If you flip between two checkpoints by hand once a session, use whatever switch you already have and go generate something.
Reach for it when the index is animated: a signal creeping from 0 to 1 to dissolve between two versions of a plate, a slow LFO drifting across a bank of four textures so the image never quite repeats, a bank of eight test renders with one control instead of eight bypass clicks.
The other honest use is a comparison rig: one operator's input into source 1, its output into source 2, then scrub the index. A boolean switch can't do that convincingly - a snap hides exactly the thing you're evaluating.
Output is a single image, so it drops wherever an IMAGE goes: preview, ꘇ top.composite background, a feedback loop source, an output view.
Installing it
Same pack, one folder:
cd ComfyUI/custom_nodes
git clone https://github.com/languel/genereti.git genereti
./.venv/bin/python -m pip install -r genereti/requirements.txt # ComfyUI's own Python
Swap in .\.venv\Scripts\python.exe on Windows or python_embeded\python.exe for Portable. No models and no torch install - Comfy provides torch, NumPy and Pillow; the requirement is basically a frontend floor. Manager search "Genereti" works when the registry listing is live; git is the dependable route. Restart ComfyUI, then hard-refresh the browser page.
The autogrow socket bank is the one place this node depends on a recent frontend. On an older build you'll get a single, sad socket that never grows.
Where people get burned
- Wrong image at the wrong index. You removed a wire from the middle of the bank and the numbering shifted. Connected sources only, zero-based, always.
- The index "doesn't do anything." In
intmode 1.9 and 1.1 both give you source 2 - it floors. For a crossfade you needfloat. - Index out of range is silent. It clamps, so past the last connected source you just get the last source forever. Same at the low end.
- Queue batch errors. The queued path takes matching image batches, or a single second image broadcast across the first batch. Two mismatched batches raises rather than guessing.
- Live throws a WebGPU error. The browser path needs a WebGPU-capable browser and adapter; if it isn't there, Queue still works - though Queue only evaluates the number you typed, so index-driving signals are a Live feature.
- Old split installs. If
genereti_comfy_textureand friends are still incustom_nodes, the pack refuses to load and tells you to move them outside. One layout at a time.
Worth repeating from the README, since it applies the moment you start performing with this: super-alpha classroom release, back up your workflows before you update, and don't be surprised if the switch's sockets move around when you do.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | 2 options: int, float | |
| index | FLOAT | 0.000–63 | Zero-based index of connected sources; int floors, float blends adjacent sources. Clamped to available sources. |
| sourcesopt | COMFY_AUTOGROW_V3 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |