Command Picker Serving
Route different commands to different parts of your workflow
- serving_config
- should_execute
CommandPickerServing is the toolkit's command router: it makes a branch of your workflow fire only when a specific command comes in. If you've built a bot with more than one thing it can do - !generate for txt2img, !upscale for a hires pass, !help for instructions - this is the node that keeps those branches from all running at once. Every entry point in the pack funnels into it, and it decides which output nodes actually execute.
The way it works is a little unusual, and it's worth understanding because it explains why your graph "just knows" which command to run. The node uses lazy evaluation: ComfyUI asks it which inputs it actually needs before execution. When the serving config arrives, CommandPickerServing checks whether the incoming command matches its command_name. If it doesn't match, the node returns "don't execute" and the attached output branch is skipped entirely. If it does match, the node pulls in the should_execute signal and runs its connected output - and only then.
That command_name string is also what registers the command in the first place. The entry point nodes (Discord, Telegram, HTTP, WebSocket) check a registry before they'll accept a message, and this node's lazy-loading call is what adds the command to that registry. That's why a bot silently ignores !upscale until you've placed a CommandPickerServing with command_name = "upscale" in the graph - there's no error, the message just doesn't get through. This is the single most common "my bot ignores commands" gotcha in the whole pack.
What counts as a "command" differs per platform, per the README: on Discord it's the first token after !, on Telegram after /, on HTTP it's the path after the slash (so POST /upscale), and on WebSocket it's the command_name JSON property. Same node, platform-appropriate behavior.
Inputs: serving_config, command_name, and should_execute (the output signal from one of the output nodes - ServingOutput, ServingTextOutput, ServingMultiImageOutput - or a chain of them). It's an output node with no outputs of its own; it exists to gate execution.
The usual pattern: one CommandPickerServing per command you support, each pointing at its own output branch. A !help branch typically pairs a picker with a ServingTextOutput that has the help text baked into the node. And unlike AlwaysExecute, which fires for everything, this node is strict - only the matching command runs its branch.
Install is the shared pack install (ComfyUI Manager, or clone into custom_nodes + pip install -r requirements.txt); the node has no dependencies beyond the toolkit itself. And the standing rule applies: Auto Queue on, or nothing will be listening for the next command.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| serving_config | SERVING_CONFIG | — | |
| command_name | STRING | — | |
| should_execute | SHOULD_EXECUTE | — |
Outputs (0)
No outputs