Nodes/was-node-suite-comfyui/Logic Comparison XOR
ComfyUI Node Runs on cloud

Logic Comparison XOR

WAS's 'exactly one but not both' logic gate

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
Logic Comparison XOR

      The last of WAS's four logic gates, and the one that trips people up if they haven't used XOR before. Where AND needs both inputs true and OR needs at least one, XOR ("exclusive or") is true only when the two inputs disagree - one true and one false, in either order - and false when they match, whether that match is both true or both false. WAS's own README describes the plain sibling node bluntly: "Logic XOR: Given 2 booleans, performs '!='" - literally a not-equal comparison, which is exactly what XOR is under the hood.

      How it's different from OR

      This is the distinction that actually matters day to day: OR is true if either or both inputs are true. XOR is true only if exactly one is - feed it two true inputs and OR says true, XOR says false. If you've ever used OR somewhere and gotten a surprising true result because both conditions happened to be satisfied at once, XOR is the gate that would have caught that and told you they weren't actually in the state you wanted.

      What it's actually for

      XOR shows up less often than AND or OR in practice, but it's the right tool for two specific situations: detecting that two conditions disagree (useful for flagging an inconsistent state - say, two independent checks that should always match, and XOR flags it the moment they don't), or building toggle-style flip logic where a signal should invert a state rather than just gate it. It's built on WAS's own 1/0 boolean convention rather than ComfyUI's native BOOLEAN type, same as the rest of this logic family - expect it to play nicest with values from other WAS logic nodes like Logic Boolean or the other Logic Comparison gates.

      How to install it

      ComfyUI Manager: search "WAS Node Suite," install, restart. Manual:

      cd ComfyUI/custom_nodes
      git clone https://github.com/WASasquatch/was-node-suite-comfyui
      

      then, from inside that folder, install requirements - path/to/ComfyUI/python_embeded/python.exe -s -m pip install -r requirements.txt on portable, pip install -r requirements.txt on system Python. Restart ComfyUI; it's under WAS Suite.

      Common issues & troubleshooting

      "It's not doing what OR does." That's by design, and it's the most common confusion with this node specifically - people reach for XOR expecting OR's behavior and are surprised when two true inputs produce a false output. If you actually want "true when either or both conditions hold," you want Logic Comparison OR, not this one.

      Type mismatches producing wrong-looking results. Same standing issue as the rest of this logic family: confirm the values feeding this node are genuinely WAS's 1/0 convention and not a native BOOLEAN from an unrelated pack that merely looks compatible. Trace each input to its source node if the output doesn't match your expectation.

      Pack-wide caveat still applies: WAS Node Suite has had no active development since the author marked it retired in December 2023, and the recurring failure is the whole suite refusing to import after a ComfyUI update - usually a stale pinned dependency. If that hits, reinstall requirements.txt using your embedded Python interpreter specifically, and restart.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs