ComfyPilotComfyPilot
文档 / 节点说明 / ComfySoftSwitchNode

ComfySoftSwitchNode

Soft Switch 节点根据布尔条件在两个可能的输入值之间进行选择。当 switch 为 true 时,它输出 ontrue 输入的值;当 switch 为 false 时,输出 onfalse 输入的值。

节点说明 ComfySoftSwitchNode 更新于 2026-11-12

查看官方原文

ComfySoftSwitchNode - ComfyUI Built-in Node Documentation

Soft Switch 节点根据布尔条件在两个可能的输入值之间进行选择。当 switch 为 true 时,它输出 ontrue 输入的值;当 switch 为 false 时,输出 onfalse 输入的值。

Soft Switch 节点根据布尔条件在两个可能的输入值之间进行选择。当 switch 为 true 时,它输出 on_true 输入的值;当 switch 为 false 时,输出 on_false 输入的值。此节点采用惰性设计,意味着它仅根据 switch 状态评估实际需要的输入。

输入

参数描述数据类型必需范围
switch用于确定传递哪个输入的布尔条件。当为 true 时,选择 on_true 输入。当为 false 时,选择 on_false 输入。BOOLEAN是True or False
on_false当 switch 条件为 false 时要输出的值。此输入为可选,但 on_false 或 on_true 中至少有一个必须连接。MATCH\_TYPE否与 on_true 相同的数据类型
on_true当 switch 条件为 true 时要输出的值。此输入为可选,但 on_false 或 on_true 中至少有一个必须连接。MATCH\_TYPE否与 on_false 相同的数据类型

注意: on_false 和 on_true 输入必须具有相同的数据类型,具体由节点的内部模板定义。这两个输入中至少有一个必须连接,否则节点将返回验证消息 "At least one of on\_false or on\_true must be connected to Switch node"。由于该节点采用惰性求值,当仅连接一个输入时,无论 switch 状态如何,节点始终输出该输入的值。

输出

输出名称描述数据类型
output选定的值。它与已连接的 on_false 或 on_true 输入的数据类型匹配。当两个输入都连接时,如果 switch 为 true,则输出 on_true;如果 switch 为 false,则输出 on_false。MATCH\_TYPE
本文档由 AI 生成。如果您发现任何错误或有改进建议,欢迎贡献! 在 GitHub 上编辑

Source fingerprint (SHA-256): 7bf4bed69d8fd8c360e971ab8068382cd8ebaa02004d5df44312977a7309ae00