ComfyUI Node

SN74HC86

Four XOR gates for either/or routing in ComfyUI

By mirabarukaso·Created 2 years ago·Updated 6 days ago· 206
SN74HC86
  • A1
  • B1
  • A2
  • B2
  • A3
  • B3
  • A4
  • B4
  • 1Y
  • 2Y
  • 3Y
  • 4Y

That's a real chip - the SN74HC86 is a quad 2-input XOR gate, four exclusive-OR gates in one package - and mirabarukaso turned it into a ComfyUI node. It's part of a little 7400-series-themed corner of the Mira pack where the logic nodes are named after the actual TTL/CMOS chips they mimic. Under the joke, this one is a genuinely useful either/or router: give each gate two inputs, and it passes whichever one is present.

The key is that "XOR" here isn't boolean math on true/false - it's an exclusivity rule on presence. Both A and B are wildcard sockets, so a gate looks at whether each side has a value and routes accordingly. That makes it a clean way to say "use A or B, but they should never both be connected at once," across four independent channels.

How it works

Each of the four gates follows this presence-XOR table (straight from the README):

  • A present, B absent → output is A
  • A absent, B present → output is B
  • both present → None
  • both absent → None

So a gate forwards the single input that exists, and returns None when the inputs are ambiguous (both or neither). Four gates means you can route four separate either/or decisions in one node. Like the rest of the 74-family, it's built to pair with Mira's None-aware nodes that do something sensible when a value comes back empty.

The inputs and outputs

Eight optional wildcard inputs in four pairs - A1/B1, A2/B2, A3/B3, A4/B4 - and four wildcard outputs, 1Y, 2Y, 3Y, 4Y, one per pair. Inputs are optional precisely because "absent" is a meaningful state the logic reads.

Installing it

Install the pack. ComfyUI Manager: Manager -> Custom Nodes Manager, search ComfyUI_Mira, Install, restart. Or clone:

cd ComfyUI/custom_nodes
git clone https://github.com/mirabarukaso/ComfyUI_Mira.git

Restart; on a load error run pip install -r requirements.txt inside the folder and restart. No models.

Common issues

The behavior people don't expect is the "both connected" case: it outputs None, not both, not the first one. XOR is exclusive - if you wire both A and B on a gate, you get nothing. If a channel keeps coming out empty, check you haven't accidentally fed both sides.

And as with the other 74-family gates, a None output will trip up ordinary downstream nodes that expect a real value. This node is meant to feed None-aware consumers - Mira's Function Select Auto (which grabs whichever input isn't None) or None To Zero (which substitutes a default). Wire 1Y straight into a normal image or conditioning node and a None result will error rather than skip.

Wildcard sockets also mean ComfyUI won't type-check the wire for you, so keep each input and its eventual consumer type-compatible yourself.

It's part of ComfyUI_Mira, mirabarukaso's personal utility pack (they're better known for the WAI Character Select app). The chip-naming is a dev in-joke - the README links the Wikipedia list of 7400-series ICs - but the node is a legitimately tidy four-channel router. If you only need a simple on/off pass-through on one wire, its single-gate sibling SN74LVC1G125 is the lighter tool.

CategoryMira/Logic/74

Inputs (8)

NameTypeDefaultDescription
A1opt*
B1opt*
A2opt*
B2opt*
A3opt*
B3opt*
A4opt*
B4opt*

Outputs (4)

NameTypeDescription
1Y*
2Y*
3Y*
4Y*