IF Int Condition:
The DP IF Int Condition node is designed to facilitate logical decision-making within your AI art projects by evaluating integer-based conditions. This node allows you to define two separate conditions, where the first condition is mandatory and the second is optional, acting as an "OR" condition. By comparing integer values using logical operators such as "equal," "smaller," and "bigger," the node determines which result to output based on whether the conditions are met. This functionality is particularly useful for creating dynamic and responsive art pieces that adapt based on numerical inputs, enhancing the interactivity and complexity of your projects.
IF Int Condition Input Parameters:
if_value
This parameter represents the integer value that you want to evaluate against the first condition. It serves as the primary input for the logical comparison. The default value is 0, with a minimum of -18,446,744,073,709,551,615 and a maximum of 18,446,744,073,709,551,615. Adjusting this value will directly impact whether the first condition is met.
if_logic
This parameter specifies the logical operator used for the first condition. You can choose from "equal," "smaller," or "bigger," which determine how the if_value is compared to compare_if_with. The choice of logic affects the outcome of the condition check.
compare_if_with
This integer parameter is the value against which if_value is compared using the if_logic operator. It has the same range as if_value, with a default of 0. This parameter is crucial for defining the threshold or target value for the first condition.
or_value
This parameter is used in the optional second condition, acting as an "OR" condition. It is an integer value that will be compared to compare_or_value if the first condition is not met. The default is 0, with the same range as if_value.
compare_or_with
This parameter determines the logical operator for the second condition. Options include "off," "equal," "smaller," and "bigger." If set to "off," the second condition is ignored. Otherwise, it defines how or_value is compared to compare_or_value.
compare_or_value
This integer parameter is the value against which or_value is compared using the compare_or_with operator. It shares the same range and default as if_value. This parameter is essential for setting the criteria for the optional second condition.
result_if_true
This parameter defines the integer result returned by the node if either the first or second condition is met. The default value is 1, with the same range as if_value. It allows you to specify the desired output when conditions are satisfied.
result_if_false
This parameter specifies the integer result returned if neither condition is met. The default is 0, with the same range as if_value. It provides a fallback output when conditions are not satisfied.
IF Int Condition Output Parameters:
INT
The output of this node is a single integer value. It represents the result of the condition evaluation, either result_if_true or result_if_false, depending on whether the specified conditions are met. This output can be used to drive further logic or influence other aspects of your AI art project.
IF Int Condition Usage Tips:
- Use the
if_logicandcompare_if_withparameters to set up a primary condition that aligns with your project's needs, ensuring that theif_valueis appropriately compared. - Leverage the
compare_or_withandcompare_or_valueparameters to create a secondary condition that provides flexibility and adaptability, especially when the primary condition might not always be met.
IF Int Condition Common Errors and Solutions:
Incorrect Logical Operator
- Explanation: Using an invalid logical operator in
if_logicorcompare_or_with. - Solution: Ensure that the logical operators are set to one of the valid options: "equal," "smaller," or "bigger."
Unmet Conditions
- Explanation: Neither condition is met, resulting in the
result_if_falseoutput. - Solution: Verify that the input values and logical operators are correctly configured to meet at least one condition, or adjust the
result_if_falseto a more suitable fallback value.
