Nodes/ComfyUI-ZML-Image/ZML_切换输出-五
ComfyUI Node

ZML_切换输出-五

One input, five possible destinations, one integer to choose

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_切换输出-五
  • 输入
  • 输出1
  • 输出2
  • 输出3
  • 输出4
  • 输出5
索引1

ZML_SwitchOutputFive is the bigger sibling of the pack's A/B switch: same any-type input, but instead of a boolean and two outputs, you get an integer index and five outputs. Set 索引 to 1 and the input appears on 输出1; set it to 3 and it appears on 输出3; nothing else changes. It's the switch you reach for when "two pipelines" isn't enough and you're juggling five variants of a branch.

The input socket is wildcard-typed (*), so it routes models, latents, images, conditioning - whatever you throw at it. The node doesn't inspect the data, it just moves it.

The inputs and outputs

  • 输入 (required, any type) - the value to route.
  • 索引 (required, INT, 1–5) - which output gets the value. The tooltip is straightforward: "1-5 selects the corresponding output." If you somehow feed it a value outside 1–5 it quietly falls back to 1 instead of erroring.

Outputs are 输出1 through 输出5, all any-type.

The placeholder behavior, same as its sibling

The unselected outputs follow the exact same design as ZML_SwitchOutput, which is worth knowing before you wire it:

  • For integers and strings, the unselected outputs return empty values (0 or "") so downstream text/int chains don't error.
  • For everything else (images, models, latents, conditioning), the unselected outputs return an ExecutionBlocker, so ComfyUI skips those entire downstream subgraphs. Only the branch you picked executes any real work.

That's the feature that makes this more than a junction box: switching a branch off is pruning it from execution, not just leaving it unread. A five-way split with four dead branches still only runs the one you selected.

Where it fits

The natural use is an index-selected multi-config rig: five different LoRA/checkpoint stacks, or five save-targets, or five prompt branches, all selected by a single integer. Because the selector is just an INT, you can drive it from anything that outputs a number - a ZML_SequentialIntegerLoader stepping through 1–5 for a sweep, a random integer for "pick a random pipeline," or a logic node that computed which branch should be live. That's the real strength over the two-way version: an integer is easier to generate automatically than a boolean is.

Install

ComfyUI Manager → search "ComfyUI-ZML-Image", or cd ComfyUI/custom_nodes && git clone https://github.com/zml-w/ComfyUI-ZML-Image, restart. Displayed as ZML_切换输出-五 in the Chinese-default UI; the English patch translates it. No models or extra dependencies.

Categoryimage/ZML_图像/逻辑

Inputs (2)

NameTypeDefaultDescription
输入*
索引INT11–5

Outputs (5)

NameTypeDescription
输出1*
输出2*
输出3*
输出4*
输出5*