뒤로
Switch Node

This tutorial workflow demonstrates how to use ComfyUI's ComfySwitchNode to route between two inputs with a simple boolean toggle. It includes two focused examples: Example 1 - String Selection shows how to switch between two prompt strings using PrimitiveString and PrimitiveStringMultiline, previewing the active choice with PreviewAny. Example 2 - LoRA Switch shows how to toggle a LoRA on and off around a base model: UNETLoader loads Z-Image-Turbo, LoraLoaderModelOnly applies a selected LoRA, and a ComfySwitchNode chooses either the plain UNet (on_false) or the LoRA-modified UNet (on_true) to feed the generation node.

Under the hood, ComfySwitchNode exposes four pins: on_false, on_true, switch (boolean), and output. When the switch is OFF (false), the output forwards whatever is connected to on_false; when ON (true), it forwards on_true. The workflow wires these switches to real tasks. The text switch selects a single prompt string used downstream, and the LoRA switch controls whether a LoRA weight is applied to the Z-Image-Turbo UNet before image generation. A SaveImage node captures results for easy A/B comparison, and MarkdownNote blocks explain the routing inline. The generation path uses Z-Image-Turbo via UNETLoader and a generation node (ID 0f79b7f9-d214-4587-b475-bc429519b976) that consumes the chosen model and prompt to render images.