ComfyUI > Nodes > ControlFlowUtils > 🚫 NOT (Invert Condition)

ComfyUI Node: 🚫 NOT (Invert Condition)

Class Name

InvertCondition

Category
🐺 VykosX-ControlFlowUtils
Author
VykosX (Account age: 2024days)
Extension
ControlFlowUtils
Latest Updated
2024-10-01
Github Stars
0.06K

How to Install ControlFlowUtils

Install this extension via the ComfyUI Manager by searching for ControlFlowUtils
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ControlFlowUtils 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

🚫 NOT (Invert Condition) Description

Reverse condition outcome with NOT gate functionality for AI art project flow control.

🚫 NOT (Invert Condition):

The InvertCondition node is designed to reverse the outcome of a given condition, effectively acting as a NOT gate. This node is particularly useful when you need to invert the result of a condition evaluation, such as turning a True result into False and vice versa. It supports both Boolean and Logical NOT operations, making it versatile for different types of data. The Boolean NOT operation is straightforward, flipping the truth value, while the Logical NOT operation performs a binary inversion, which is more suitable for numeric values. This node is essential for controlling the flow of execution in your AI art projects, allowing you to dynamically alter the behavior of your prompts based on inverted conditions.

🚫 NOT (Invert Condition) Input Parameters:

condition

This parameter specifies the condition to be evaluated and inverted. It can take various forms such as "A is TRUE", "B is TRUE", "A is NONE", "B is NONE", "A == B", "A != B", "A > B", "A >= B", "A < B", "A <= B", "A is B", "A is not B", "A in B", "B in A", "A & B", "A | B", "A ^ B", and "CUSTOM". The condition determines the initial evaluation before inversion. For example, if the condition is "A == B" and A equals B, the result will be True before inversion.

require_inputs

This Boolean parameter determines whether the TRUE_IN and FALSE_IN inputs should be forwarded based on the condition's result. If set to True, the node will forward the TRUE_IN or FALSE_IN inputs depending on the condition's evaluation. If set to False, the node will return Boolean results directly. The default value is True, with "Return Inputs" as the label when enabled and "Return Boolean" when disabled.

NOT

This Boolean parameter indicates whether the result of the condition should be inverted post-evaluation. When enabled, the node will flip the result of the condition, turning True into False and vice versa. This is the core functionality of the InvertCondition node. The tooltip for this parameter is "Invert the result of the condition post-evaluation".

custom_expression

This String parameter is used when the condition is set to "CUSTOM". It allows you to define a custom expression for the condition. The expression can use variables A and B, as well as any named global variables from Memory Storage nodes. The default value is "2a == 5b+2", and it supports multiline input. This parameter is only active when the condition is "CUSTOM", and it is disabled otherwise.

input

This parameter accepts any type of data that will be forwarded to other nodes after inverting the condition. It is used to pass the data through the node based on the inverted condition's result.

mode

This Boolean parameter determines the type of NOT operation to be executed. If set to True, a Boolean NOT operation will be performed. If set to False, a Logical NOT operation (binary inversion) will be executed. The default value is True, with "boolean" as the label when enabled and "logical" when disabled.

🚫 NOT (Invert Condition) Output Parameters:

output

This parameter provides the data that will be forwarded to other nodes after the condition has been inverted. The output depends on the mode and the initial condition's evaluation. If the mode is Boolean, the output will be the inverted Boolean result. If the mode is Logical, the output will be the binary-inverted value.

🚫 NOT (Invert Condition) Usage Tips:

  • Use the NOT parameter to easily invert the result of any condition, allowing for more dynamic and flexible control flows in your AI art projects.
  • When working with numeric values, set the mode to Logical to perform a binary inversion, which can be useful for bitwise operations.
  • Utilize the custom_expression parameter to define complex conditions that are not covered by the predefined options, enabling more advanced logic in your workflows.
  • Enable require_inputs to forward specific inputs based on the condition's result, which can help in creating more intricate and conditional data flows.

🚫 NOT (Invert Condition) Common Errors and Solutions:

"Unable to block execution, please update your ComfyUI to enable this functionality!"

  • Explanation: This error occurs when the node tries to block execution due to a failed condition, but the ComfyUI version does not support this functionality.
  • Solution: Update your ComfyUI to the latest version to ensure compatibility with the InvertCondition node's execution blocking feature.

"ERROR PROCESSING CONDITION: <error_message>. DEFAULTING TO FALSE."

  • Explanation: This error indicates that there was an issue processing the specified condition, and the node defaulted to a False result.
  • Solution: Check the condition and custom_expression parameters for any syntax errors or unsupported operations. Ensure that the inputs A and B are valid and compatible with the specified condition.

🚫 NOT (Invert Condition) Related Nodes

Go back to the extension to check out more related nodes.
ControlFlowUtils
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.