Nodes/ComfyUI_Lam/开关控制
ComfyUI Node

开关控制

A master on/off for any branch of your graph

By yanlang0123·Created 2 years ago·Updated about a month ago· 76
开关控制
  • base
  • base

LamSwitchStart ("开关控制", switch control) is the anchor of the ComfyUI_Lam pack's switch family. On its own it does almost nothing - it takes whatever you feed it and hands the exact same thing back out. That's the point. It's the control panel you flip to decide which of several downstream branches actually runs.

Here's the workflow it's built for. You've got two ways to reach the same point in your graph - maybe a raw txt2img pass and an img2img pass, or two different ControlNet rigs - and you want to keep both wired up so you can switch between them without deleting half your graph. That's what rgthree-style toggles do for whole groups; this does it at the branch level, inside the Lam pack's own conventions. The Start node carries a comma-separated switch state (one 0/1 per downstream segment), and the pack's LamSwitchMiddle ("开关分段") nodes read their own bit from it: 1 means route the new branch in, 0 means keep passing the base through. You only touch the Start node to flip things - the segments follow it.

The inputs that matter

It's a thin node, so there isn't much to configure:

  • base (any type) - whatever flows in. Image, conditioning, model, string, it doesn't care.
  • Output: base (any type) - the same value, passed through unchanged.

The real control is a widget on the node that stores the switch string for the chain. Don't go looking for a fancy switch input in the schema - the toggling happens via that hidden widget plus the Middle nodes. If you only ever use Start alone, it's just a very expensive Reroute.

Installing it

This ships in the ComfyUI_Lam pack. Either way you install the pack, you get the whole family - you can't get just the switch nodes:

# via ComfyUI Manager: search "ComfyUI_Lam"
cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam

Then restart ComfyUI. For the switch nodes specifically you don't need any of the pack's model downloads - no ControlNet-Lama weights, no face-fusion archives. The switch family is pure graph logic.

Common issues

The one honest gotcha is the pack's baggage, not this node. ComfyUI_Lam's README walks you through a setup that includes extracting bundled rars into site-packages and pip-installing an ancient pinned requirements list (TensorFlow 2.12, numpy 1.23.4, dlib...) from a hardcoded Aliyun mirror. You do not want any of that for switches. If you installed the whole pack through the README's install.bat, and ComfyUI suddenly won't boot because numpy got downgraded, that's the culprit - either pin it back or start from a clean environment and skip the heavy install steps.

Second, the pack ships a frontend extension that can throw a leftover popup even after you delete the folder. If you uninstall ComfyUI_Lam and a "请先添加AppParams节点" alert keeps appearing at launch, remove ComfyUI/web/extensions/lam too - the extension gets linked there and doesn't clean itself up.

Otherwise: if the switch seems to do nothing, check that you actually chained LamSwitchMiddle segments off it. Start alone is a pass-through by design. It's a small, opinionated utility from a pack with a Chinese-language UI - the node titles are in Chinese by default - but the logic is dead simple once you've seen one chain.

Categorylam

Inputs (1)

NameTypeDefaultDescription
base*

Outputs (1)

NameTypeDescription
base*