ComfyUI > Nodes > ComfyUI-YCNodes > Text Condition Switch (YC)

ComfyUI Node: Text Condition Switch (YC)

Class Name

YC Text Condition Switch

Category
YCNode/Logic
Author
yichengup (Account age: 473days)
Extension
ComfyUI-YCNodes
Latest Updated
2025-06-03
Github Stars
0.02K

How to Install ComfyUI-YCNodes

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

Facilitates text-based decision-making and conditional image selection in AI art workflows.

Text Condition Switch (YC):

The YC Text Condition Switch node is designed to facilitate decision-making processes based on text comparison. It allows you to compare an input text against a preset text and determine whether they match. This node is particularly useful in scenarios where you need to conditionally select between two images based on the result of the text comparison. By providing a straightforward mechanism to handle text-based conditions, it enhances the flexibility and control within your AI art workflows, enabling you to automate decisions and streamline processes based on textual data.

Text Condition Switch (YC) Input Parameters:

input_text

This parameter represents the text input that you want to compare against a preset text. It is a string value and serves as the primary input for the condition check. The comparison's outcome will depend on this text, making it crucial for determining the node's behavior. There are no specific minimum or maximum values, but it defaults to an empty string.

preset_text

The preset_text parameter is the reference text against which the input_text is compared. It is also a string value and acts as the benchmark for the comparison. The node uses this text to decide whether the input_text matches, influencing the output image selection. Like input_text, it defaults to an empty string.

case_sensitive

This boolean parameter determines whether the text comparison should be case-sensitive. If set to true, the comparison will consider the case of the characters, meaning "Text" and "text" would be considered different. If false, the comparison ignores case differences, treating "Text" and "text" as identical. The default value is true, which means the comparison is case-sensitive by default.

image_a

This optional parameter is an image that will be output if the input_text matches the preset_text. It allows you to specify the image to be used when the condition is met, providing a visual representation of a successful match. There is no default image, and it is only used if provided.

image_b

Similar to image_a, this optional parameter is an image that will be output if the input_text does not match the preset_text. It serves as the alternative visual output when the condition is not met, allowing you to handle mismatches effectively. Like image_a, there is no default image, and it is only used if provided.

Text Condition Switch (YC) Output Parameters:

image

This output parameter is the image selected based on the text comparison result. If the input_text matches the preset_text, image_a is returned; otherwise, image_b is returned. This output provides a visual indication of the comparison result, making it a crucial part of the node's functionality.

is_matched

The is_matched output is a boolean value indicating whether the input_text matched the preset_text. It returns true if the texts match and false otherwise. This output is essential for understanding the result of the text comparison and can be used to trigger further actions or decisions in your workflow.

Text Condition Switch (YC) Usage Tips:

  • Ensure that the input_text and preset_text are correctly set to achieve the desired comparison results. Pay attention to the case_sensitive parameter to control whether the comparison should consider case differences.
  • Utilize image_a and image_b to provide clear visual feedback based on the comparison outcome. This can help in creating dynamic and responsive AI art workflows.

Text Condition Switch (YC) Common Errors and Solutions:

Missing Image Output

  • Explanation: If neither image_a nor image_b is provided, the node may not output an image.
  • Solution: Ensure that at least one of the image parameters (image_a or image_b) is connected to an image source.

Incorrect Text Comparison

  • Explanation: The input_text and preset_text may not match as expected due to case sensitivity.
  • Solution: Verify the case_sensitive parameter setting and adjust it according to your comparison needs. If case differences are not important, set case_sensitive to false.

Text Condition Switch (YC) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-YCNodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.