ComfyUI Node

HT Splitter

Route one value to two paths — HT Splitter

By ArtHommage·Created 2 years ago·Updated about a year ago· 4
HT Splitter
  • input_value
  • output_true
  • output_false
conditiontrue

ComfyUI doesn't have an if statement, so conditionals in a graph end up as routing nodes: take a value, look at a condition, send the value down one path or the other. HT Splitter (from the HommageTools pack) is that router. One input in, a boolean condition, and the value comes out of output_true or output_false depending on the flip of that switch.

How it works

Two inputs:

  • input_value - any type. The node uses ComfyUI's any_type, so images, latents, strings, models - whatever you connect - pass straight through. That's the useful part: it doesn't care what it's routing.
  • condition - a boolean, default true. true sends the input to output_true; false to output_false. The unused output just isn't populated.

Outputs are the two typed-as-any sockets, output_true and output_false. Wire the branch you care about into the downstream node; leave the other dangling or send it to a debug/display node.

Where this shines: A/B testing two processing paths (feed the same latent to a normal sampler and a different one, pick by a toggle), error-handling branches, and conditional value selection - pair it with a node that produces a boolean, like a mask validator or a comparison, and you've got yourself a poor man's if/else.

Installing it

HommageTools install, once:

cd ComfyUI/custom_nodes
git clone https://github.com/ArtHommage/HommageTools.git
cd HommageTools
pip install -r requirements.txt

Restart ComfyUI, or ComfyUI Manager → "HommageTools". No models or extra deps. The pack carries a perpetual-alpha disclaimer, and for a router node that mostly means: don't be shocked if a parameter moves in an update.

The gotcha that will bite you

The splitter routes data; it does not gate execution. In ComfyUI, any node you've wired gets executed when its inputs are ready - even if its output feeds nothing, and even if it's on the "wrong" branch. So if you connect both output_true and output_false to two expensive samplers, both samplers run on every queue, and the splitter just decides which output you actually read. That's usually not what people expect the first time. The splitter picks which value flows on; it doesn't stop the other branch from computing.

If you genuinely want to skip a whole branch - not just pick its result - you need a node that mutes/bypasses sections based on state (the HommageTools pack has HT Node State Controller and friends for that), or you build the branch so its cost is negligible. Treat HT Splitter as a value router with a light mental model: cheap, flexible, but not a circuit breaker.

CategoryHommageTools

Inputs (2)

NameTypeDefaultDescription
input_value*
conditionBOOLEANtrue

Outputs (2)

NameTypeDescription
output_true*
output_false*