ComfyUI > Nodes > ComfyUI-YCNodes > Universal Condition Gate (YC)

ComfyUI Node: Universal Condition Gate (YC)

Class Name

YC Universal Gate

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

Universal Condition Gate (YC) Description

Versatile node for text-based conditional gating, enhancing workflow efficiency for AI artists.

Universal Condition Gate (YC):

The YC Universal Gate is a versatile node designed to act as a conditional gate between any two nodes based on text comparison. Its primary function is to determine whether an input text matches a preset text, allowing or blocking the passage of data accordingly. This node is particularly beneficial for scenarios where conditional logic is required, such as filtering or routing data based on specific criteria. By providing a simple yet powerful mechanism to control data flow, the YC Universal Gate enhances the flexibility and efficiency of your workflows, making it an essential tool for AI artists who need to implement conditional logic without delving into complex programming.

Universal Condition Gate (YC) Input Parameters:

input_text

The input_text parameter is a string input that represents the text you want to compare against a preset text. This parameter is crucial as it serves as the primary data point for the node's conditional logic. The comparison determines whether the data will pass through the gate. The default value is an empty string, and it does not support multiline input. This parameter's impact is significant as it directly influences the node's decision-making process.

preset_text

The preset_text parameter is another string input that serves as the reference text for comparison with the input_text. This parameter is essential for defining the condition under which the gate will allow data to pass. Like input_text, it defaults to an empty string and does not support multiline input. The accuracy and relevance of this text are vital for the node's effective operation.

case_sensitive

The case_sensitive parameter is a boolean that determines whether the text comparison should consider case differences. When set to True, the comparison will be case-sensitive, meaning "Text" and "text" would be considered different. The default value is True, and this parameter is important for ensuring that the comparison aligns with your specific requirements, especially in cases where case sensitivity is crucial.

invert

The invert parameter is a boolean that, when enabled, inverts the result of the text comparison. This means that if the texts match, the gate will block the data, and if they do not match, the gate will allow the data to pass. This parameter is useful for scenarios where you want to implement a reverse logic condition. The default value is not specified in the context, but its role is to provide additional flexibility in how conditions are applied.

Universal Condition Gate (YC) Output Parameters:

output

The output parameter represents the result of the gate's decision-making process. If the input text matches the preset text (considering the case sensitivity and invert settings), the output will be the data that was allowed to pass through the gate. This parameter is crucial as it indicates whether the condition was met and the data was successfully routed.

is_matched

The is_matched parameter is a boolean output that indicates whether the input text matched the preset text based on the specified conditions. This output is important for understanding the result of the comparison and can be used for further logic or decision-making processes in your workflow.

Universal Condition Gate (YC) Usage Tips:

  • Ensure that the input_text and preset_text are correctly set to reflect the conditions you want to apply. This will help in achieving the desired data flow control.
  • Use the case_sensitive parameter wisely, especially when dealing with text data where case differences are significant. This can prevent unexpected results in your workflow.
  • Consider using the invert parameter to implement reverse logic conditions, which can be useful in scenarios where you want to block data that matches certain criteria.

Universal Condition Gate (YC) Common Errors and Solutions:

Input text not provided

  • Explanation: This error occurs when the input_text parameter is left empty or not connected.
  • Solution: Ensure that you provide a valid string for the input_text parameter to enable the node to perform the comparison.

Preset text not provided

  • Explanation: This error arises when the preset_text parameter is not set or left empty.
  • Solution: Set a valid string for the preset_text parameter to define the condition for the gate.

Case sensitivity mismatch

  • Explanation: This issue happens when the case_sensitive parameter is not set according to the intended comparison logic.
  • Solution: Verify and adjust the case_sensitive parameter to match your specific requirements for text comparison.

Invert logic not applied correctly

  • Explanation: This error occurs when the invert parameter is not used as intended, leading to unexpected data flow.
  • Solution: Review the invert parameter setting to ensure it aligns with your desired logic for the gate's operation.

Universal Condition Gate (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.