Nodes/Mickmumpitz-Nodes/Preprocess Switch
ComfyUI Node

Preprocess Switch

The lazy router that only runs the preprocessor you picked

By mickmumpitz·Created 8 months ago·Updated 10 days ago· 47
Preprocess Switch
  • signal
  • original
  • depth
  • canny
  • pose
  • image

Preprocess Switch is the payoff node for the pack's preprocess selector trio (PreprocessSettings, Simple, Single). Those nodes just emit a PREPROCESS_SIGNAL; this is the node that actually decides which image flows through. Wire it the original image plus depth, canny, and pose versions, feed it a signal, and it routes exactly the one you asked for - and, thanks to lazy evaluation, the other three preprocessors never even run.

That last bit is the whole point. Preprocessors are expensive - a depth model and a pose detector each eat VRAM and seconds. A dumb switch would run all four and pick one. This one tells ComfyUI which inputs it needs before they execute, so your graph only pays for the condition you're actually using.

How it works

The node has a check_lazy_status method that ComfyUI calls before execution: given the current signal, it returns the list of inputs it actually needs. Signal "depth" → only depth is required. Signal "none" → only original. And the combo signals are where it earns the name: "depth + canny" asks for both and returns a batch of both maps, so downstream ControlNet (or whatever) sees two frames of conditioning instead of one.

The routing itself is a straight passthrough of the selected input - no processing happens inside the switch. It's pure lazy selection, which makes it a close cousin of the pack's MatchModeSwitch, just built for the preprocess stage of the graph.

The inputs and outputs

  • signal (PREPROCESS_SIGNAL, required) - from one of the three PreprocessSettings nodes.
  • original (IMAGE, lazy) - the unprocessed frame; used when the signal is "none" (i.e. preprocessing is disabled).
  • depth, canny, pose (IMAGE, lazy) - the preprocessed maps.

The single output, image - the selected condition (or a batch of two for combos), ready for a ControlNet apply or similar.

Installing it

Part of the Mickmumpitz pack - ComfyUI Manager, search "Mickmumpitz", install, restart:

cd ComfyUI/custom_nodes
git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes.git

No models of its own; the preprocessors you wire in are the ones doing the work.

Common issues

Two things to keep straight. First, the signal type: only the pack's settings nodes emit PREPROCESS_SIGNAL, so the switch won't accept a plain string - keep the pair together. Second, lazy inputs mean unselected branches don't run, which is the feature, but it also means an unconnected selected branch gives you nothing. If you set the signal to "pose" but never wired the pose input, you get an empty result with no error - check the wiring matches the signal. And a practical note from the control-side: combo signals emit a two-image batch, so make sure whatever's downstream accepts a batch of two conditioning frames rather than assuming a single one.

CategoryMickmumpitz/utils

Inputs (5)

NameTypeDefaultDescription
signalPREPROCESS_SIGNAL
originaloptIMAGE
depthoptIMAGE
cannyoptIMAGE
poseoptIMAGE

Outputs (1)

NameTypeDescription
imageIMAGE