Sensor Switch Image
The Image Switch That Picks the Live Input
- image_true
- image_false
- image
Switch nodes are the duct tape of ComfyUI - a thousand workflows need "send either A or B to this input." The Sensor Switch Image is that familiar tool with one genuinely useful twist: it detects which of its two inputs is actually connected and routes that one through automatically.
The canonical use case is bypassing. Say you want a workflow that can use either a generated image (from a VAE Decode) or a loaded one (from Load Image), and you flip between them by bypassing one branch. With a normal switch, bypassing a node doesn't sever the wire in the graph's data sense - you'd have to reach into the switch and change its setting. The sensor version reads the graph state: connect the VAE Decode output to image_true and the Load Image output to image_false, bypass whichever branch you don't want, and the sensor sends the live one to your destination. That's the whole "sensor" magic.
Inputs and outputs
Simple shape: a switch boolean (default true), two optional image inputs (image_true, image_false), and one image output. The logic from the source is dead simple:
- Only
image_trueconnected → output it. - Only
image_falseconnected → output it. - Both connected → output
image_trueifswitchis on, elseimage_false. - Neither → returns None instead of erroring.
That last behavior is worth appreciating - most switches hard-error on a missing input, so the sensor is genuinely more forgiving when you're mid-build and haven't wired everything yet.
The caveat that bites
The README is blunt about the limitation: ComfyUI allows data to pass through a bypassed node, so in that specific pass-through situation the sensor won't auto-switch. In practice this means: when both inputs are wired up (which is exactly when you're toggling branches), don't trust the sensor to read your mind - set the switch toggle manually. The auto-detection shines when one input is genuinely disconnected; the toggle covers the rest.
Installing it
Manager search "ComfyUI-Fossiel-QoL-Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Fossiel/ComfyUI-Fossiel-QoL-Nodes
pip install -r ComfyUI-Fossiel-QoL-Nodes/requirements.txt
Restart and find Sensor Switch Image under Fossiel/QoL. It's one of a set of eight - Clip, Conditioning, Latent, Mask, Model, VAE, and a combined KSampler switch - all sharing this behavior, all with the same one-input-per-type footprint. If you're using the pack for anything else, this is the node family you'll actually reach for day to day.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| switch | BOOLEAN | true | — |
| image_trueopt | IMAGE | — | |
| image_falseopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |