Logic Gate (NH) — Visual Guide

NH-Nodes for ComfyUI — jetthuang.com

Scenario 1: Process only large landscape images
AND gate — Both conditions must be True to proceed. Skip small or portrait images.
NH-Nodes
Compare
width > 1024
True
NH-Nodes
Logic Gate
a = True
op = AND
b = True
True
NH-Nodes
Gate Switch
enabled = True
PASS
Upscale Model
Executes!
IMAGE
NH-Nodes
Compare
height > 1024
True
b ↑
Scenario 2: Run when EITHER condition is met
OR gate — At least one condition True. E.g., apply face fix if face detected OR user forced it.
Face Detect
face_count > 0
False
NH-Nodes
Logic Gate
a = False
op = OR
b = True
True
NH-Nodes
If/Else
condition = True
Face Fix
Boolean Switch
force_fix = True
True
b ↑
Scenario 3: Toggle pipeline OFF with NOT
NOT gate — Invert a boolean. One switch controls enable/disable.
NH-Nodes
Boolean Switch
skip_upscale = True
True
NH-Nodes
Logic Gate
a = True
op = NOT
False
NH-Nodes
Gate Switch
enabled = False
BLOCKED
Upscale 4x
Skipped!
SKIP
Truth Table
abANDORNOT aXORNANDNOR
FF FFT FTT
FT FTT TTF
TF FTF TTF
TT TTF FFF
Quick Patterns

AND: Both must pass

Check A
T
AND
T
Run

OR: Any one passes

Check A
F
OR
T
Run

NOT: Invert toggle

Skip?
T
NOT
F
Block

XOR: Only one, not both

Mode A
T
XOR
T
Run

NH-Nodes — jetthuang.com — GitHub