ComfyUI > Nodes > ComfyUI-RvTools_v2 > String Switch v2

ComfyUI Node: String Switch v2

Class Name

String Switch v2 [RvTools]

Category
🫦 RvTools II/ Switches
Author
r-vage (Account age: 317days)
Extension
ComfyUI-RvTools_v2
Latest Updated
2026-03-27
Github Stars
0.02K

How to Install ComfyUI-RvTools_v2

Install this extension via the ComfyUI Manager by searching for ComfyUI-RvTools_v2
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-RvTools_v2 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

String Switch v2 Description

String Switch v2 [RvTools] enables dynamic string selection based on conditions, optimizing GPU memory.

String Switch v2 [RvTools]:

The String Switch v2 [RvTools] node is designed to facilitate the dynamic selection between two string inputs based on a specified condition. This node is particularly useful in scenarios where you need to toggle between different string values depending on certain criteria, enhancing the flexibility and control within your workflow. One of the key features of this node is its ability to manage GPU memory efficiently through the optional Purge VRAM functionality, which can help optimize performance by clearing unused resources. This makes the node not only a versatile tool for string management but also a valuable asset in maintaining system efficiency during complex operations.

String Switch v2 [RvTools] Input Parameters:

Input

The Input parameter is an integer that determines which of the two string inputs will be selected and returned by the node. It accepts values of either 1 or 2, with a default value of 1. When set to 1, the node will return the first string input (input1), and when set to 2, it will return the second string input (input2). This parameter is crucial for directing the node's output based on your specific requirements.

Purge_VRAM

The Purge_VRAM parameter is a boolean option that, when enabled, triggers the clearing of GPU memory. This can be particularly beneficial in workflows that involve heavy computational tasks, as it helps to free up resources and prevent memory bottlenecks. By default, this parameter is set to False, meaning that VRAM purging will not occur unless explicitly activated. This feature ensures that your system remains responsive and efficient, especially in resource-intensive environments.

input1

The input1 parameter is an optional string input that serves as one of the potential outputs of the node. It is required to be provided if you intend to use it as a selectable option. This parameter allows you to specify the first string value that can be returned by the node when the Input parameter is set to 1.

input2

The input2 parameter is another optional string input, similar to input1, and is required if you wish to use it as a selectable option. It represents the second string value that the node can return when the Input parameter is set to 2. This parameter provides flexibility in choosing between different string outputs based on your workflow needs.

String Switch v2 [RvTools] Output Parameters:

string

The string output parameter is the result of the node's execution, returning one of the two string inputs (input1 or input2) based on the value of the Input parameter. This output is crucial for directing the flow of data in your workflow, allowing you to dynamically switch between different string values as needed. The returned string can then be used in subsequent nodes or processes, making this node an integral part of a flexible and adaptable system.

String Switch v2 [RvTools] Usage Tips:

  • To optimize performance in workflows with high memory usage, consider enabling the Purge_VRAM option to clear unused GPU resources and prevent memory-related issues.
  • Use the Input parameter to dynamically control which string is output, allowing for flexible and responsive workflow configurations that can adapt to changing conditions or requirements.

String Switch v2 [RvTools] Common Errors and Solutions:

Missing Input: Multi String Switch has no active Input

  • Explanation: This error occurs when neither input1 nor input2 is provided, leaving the node without a valid string to return.
  • Solution: Ensure that at least one of the string inputs (input1 or input2) is supplied to the node to avoid this error.
  • Explanation: This error may arise if the Purge_VRAM option is enabled but the necessary libraries (torch or comfy.model_management) are not installed or accessible.
  • Solution: Verify that the required libraries are installed and properly configured in your environment. If necessary, install them using a package manager like pip.

String Switch v2 Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-RvTools_v2
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.

String Switch v2