π± Artha Input Selector
A runtime switch for picking which value flows through
- in_a
- in_b
- out
Artha Input Selector is the π± Artha pack's any-type switch: two inputs, one output, and an operation dropdown that decides which value comes out. It's the workflow equivalent of a railroad switch - you build one graph with both branches populated and pick a track at run time instead of rebuilding the graph every time you want a different value.
Where this genuinely shines: A/B testing without editing. Wire two prompts (or two seeds, or two checkpoints of images) into in_a and in_b, flip the operation, and re-run. The alternative is duplicating half your workflow or editing inputs each run - this is the cleaner version of both.
How it works
The node takes two any-type inputs, in_a and in_b, and the operation combo decides the routing. The modes map roughly to:
- SELECT A / SELECT B - pass that input straight through.
- NOT NULL - pass whichever input is "truthy" (non-null, non-empty, non-zero); falls back to A if both are valid, and raises an error if neither is.
- BOTH TRUE A / BOTH TRUE B - pass A (or B) only if both inputs are truthy.
The truthiness check is the subtle part - it's not just None checking. Strings count as "valid" unless they're empty or false/0/none, numbers count if non-zero, and empty lists/dicts/tuples count as invalid. So "BOTH TRUE" modes effectively gate the output on "is this branch actually populated."
Inputs that matter
- operation - the combo that picks the behavior.
SELECT Ais the default. - in_a / in_b - the two any-type inputs, both required but force-input, so they must be wired.
Output is a single out (any-type, tooltip "Selected slot as output") that carries whatever you picked - same type as whatever you fed in.
Installing it
It's part of the one-pack Artha install:
cd ComfyUI/custom_nodes
git clone https://github.com/Cyrostar/ComfyUI-Artha-Nodes
pip install -r ComfyUI/custom_nodes/ComfyUI-Artha-Nodes/requirements.txt
restart ComfyUI, or install "ComfyUI-Artha-Nodes" through ComfyUI Manager. No API key, no model files, no extra dependencies beyond the pack's standard stack - this is pure Python routing logic.
Common issues
- Error "A and B not valid": you used
NOT NULLwith both inputs empty/false. Wire at least one real value. - Output silently goes dead with BOTH TRUE modes: if either input is falsy, that mode's contract isn't met - check what you're feeding in.
- Type mismatch surprises: because it's any-type, you can technically switch between an image and a string. That'll usually break whatever consumes it downstream. Keep both branches the same type.
The trap to watch: because both inputs are required by the schema, you can't leave one branch unpopulated and expect NOT NULL to gracefully fall through - it needs the inputs wired even if it then ignores them. Small mental cost, worth it for the A/B workflow.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| operation | COMBO | SELECT A | 5 options: SELECT A AS OUTPUT, SELECT B AS OUTPUT, NOT NULL AS OUTPUT, BOTH TRUE A AS OUTPUT, BOTH TRUE B AS OUTPUT |
| in_a | * | β | |
| in_b | * | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| out | * | Selected slot as output |