Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > Sage Utils > Text Switch

ComfyUI Node: Text Switch

Class Name

Sage_TextSwitch

Category
Sage Utils/text
Author
arcum42 (Account age: 6442days)
Extension
Sage Utils
Latest Updated
2026-05-17
Github Stars
0.03K

How to Install Sage Utils

Install this extension via the ComfyUI Manager by searching for Sage Utils
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Sage Utils in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Text Switch Description

Controls text flow by passing or replacing text based on a boolean condition.

Text Switch:

The Sage_TextSwitch node is designed to control the flow of text data based on a simple boolean condition. Its primary function is to either pass a given text string through or replace it with an empty string, depending on whether a specified condition is met. This node is particularly useful in scenarios where you need to dynamically include or exclude text content based on certain criteria, such as user input or other logical conditions. By providing a straightforward mechanism to toggle text output, Sage_TextSwitch enhances the flexibility and adaptability of text processing workflows, allowing you to create more dynamic and responsive AI art projects.

Text Switch Input Parameters:

str

This parameter represents the text string that you want to conditionally pass through the node. It is a required input and can be multiline, allowing you to input complex or lengthy text data. The content of this parameter will be passed to the output if the active parameter is set to true. There are no specific minimum or maximum values for this parameter, as it is a free-form text input.

active

The active parameter is a boolean input that determines whether the text string provided in the str parameter should be passed through to the output. If active is set to true, the text is passed as is; if false, an empty string is output instead. This parameter defaults to true, meaning that unless specified otherwise, the text will be passed through. This parameter is crucial for controlling the node's behavior and can be used to toggle the inclusion of text based on external conditions or logic.

Text Switch Output Parameters:

str_out

The str_out parameter is the output of the Sage_TextSwitch node. It provides the resulting text string based on the evaluation of the active parameter. If active is true, str_out will contain the text from the str input; if false, it will be an empty string. This output is essential for downstream nodes or processes that rely on the presence or absence of text data, allowing for conditional text processing and dynamic content generation.

Text Switch Usage Tips:

  • Use the active parameter to control the flow of text dynamically, enabling or disabling text output based on user interactions or other logical conditions in your workflow.
  • Combine Sage_TextSwitch with other nodes that manipulate or analyze text to create complex conditional logic, enhancing the interactivity and responsiveness of your AI art projects.

Text Switch Common Errors and Solutions:

Missing str Input

  • Explanation: The node requires a text input for the str parameter, but none was provided.
  • Solution: Ensure that you supply a valid text string to the str input parameter. This can be done by connecting a text-generating node or manually entering text.

Invalid active Value

  • Explanation: The active parameter expects a boolean value, but an invalid type was provided.
  • Solution: Check that the active parameter is set to either true or false. If using a dynamic input, ensure it resolves to a boolean value.

Text Switch Related Nodes

Go back to the extension to check out more related nodes.
Sage Utils
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Text Switch