ComfyUI  >  Nodes  >  ComfyUI-Logic >  Compare

ComfyUI Node: Compare

Class Name

Compare-🔬

Category
Logic
Author
theUpsider (Account age: 2731 days)
Extension
ComfyUI-Logic
Latest Updated
7/2/2024
Github Stars
0.1K

How to Install ComfyUI-Logic

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

Compare Description

Evaluate inputs, determine relationships, support various comparison functions for logical decision-making automation.

Compare:

The Compare node is designed to evaluate two inputs and determine their relationship based on a specified comparison operation. This node is particularly useful for logical operations where you need to compare values and make decisions based on the result. It supports a variety of comparison functions such as equality, inequality, and relational comparisons, making it versatile for different logical conditions. By using this node, you can streamline your workflow by automating decision-making processes based on the comparison of inputs.

Compare Input Parameters:

a

This parameter represents the first input value to be compared. It can be of any type, allowing for flexible comparisons across different data types. The default value is 0, but it can be adjusted to suit the specific needs of your comparison.

b

This parameter represents the second input value to be compared. Similar to parameter a, it can be of any type, providing versatility in the types of comparisons you can perform. The default value is 0, but it can be modified as required.

comparison

This parameter specifies the type of comparison to be performed between a and b. The available options are "a == b", "a != b", "a < b", "a > b", "a <= b", and "a >= b". The default comparison is "a == b". This parameter determines the logical operation that will be applied to the inputs, influencing the outcome of the comparison.

Compare Output Parameters:

BOOLEAN

The output of this node is a boolean value that represents the result of the comparison. If the specified comparison condition is met, the output will be True; otherwise, it will be False. This boolean output can be used in subsequent nodes to control the flow of your logic based on the comparison result.

Compare Usage Tips:

  • Use the Compare node to automate decision-making processes in your workflow by comparing values and branching logic based on the result.
  • Experiment with different comparison operations to see how they affect the outcome and choose the one that best fits your needs.
  • Combine the Compare node with other logic nodes to create complex conditional structures and enhance the functionality of your AI art projects.

Compare Common Errors and Solutions:

Invalid comparison function

  • Explanation: The specified comparison function is not recognized.
  • Solution: Ensure that the comparison parameter is set to one of the valid options: "a == b", "a != b", "a < b", "a > b", "a <= b", or "a >= b".

Type mismatch between inputs

  • Explanation: The inputs a and b are of incompatible types for the specified comparison.
  • Solution: Verify that the inputs a and b are of compatible types that can be logically compared using the specified comparison function. Adjust the input types if necessary.

Compare Related Nodes

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