ComfyUI > Nodes > ComfyUI-LogicUtils > Convert to Boolean

ComfyUI Node: Convert to Boolean

Class Name

ConvertAny2Boolean

Category
Conversion
Author
aria1th (Account age: 3016days)
Extension
ComfyUI-LogicUtils
Latest Updated
2026-01-21
Github Stars
0.1K

How to Install ComfyUI-LogicUtils

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

Convert to Boolean Description

Transforms various data types into boolean values for consistent logical operations.

Convert to Boolean:

The ConvertAny2Boolean node is designed to transform various data types into a boolean value, which is either True or False. This node is particularly useful when you need to standardize inputs of different types, such as integers, floats, or strings, into a boolean format for logical operations or decision-making processes. By converting diverse data types into a boolean, this node simplifies the handling of conditional logic in your workflows, ensuring that all inputs are evaluated consistently. This conversion is crucial in scenarios where you need to determine the truthiness of a value, allowing for more streamlined and efficient logic processing.

Convert to Boolean Input Parameters:

input1

The input1 parameter accepts any data type, including integers, floats, strings, and more. Its primary function is to serve as the input value that will be converted into a boolean. The conversion process evaluates the truthiness of the input, where non-zero numbers, non-empty strings, and other non-null values typically convert to True, while zero, empty strings, and None convert to False. The default value for this parameter is 0.0, which would convert to False. This parameter is essential as it determines the initial value that undergoes conversion, impacting the node's output.

Convert to Boolean Output Parameters:

BOOLEAN

The output of the ConvertAny2Boolean node is a boolean value, either True or False. This output represents the truthiness of the input value after conversion. The boolean output is crucial for logical operations, enabling you to make decisions based on the presence or absence of a condition. For instance, in a workflow, you might use this boolean output to trigger different actions depending on whether the input value is considered True or False. This output ensures that your logic gates or conditional nodes receive a standardized boolean input, facilitating consistent and reliable decision-making processes.

Convert to Boolean Usage Tips:

  • Use the ConvertAny2Boolean node when you need to ensure that inputs of various types are evaluated consistently in logical operations.
  • Consider the default value of 0.0 for input1, which converts to False, and adjust it if you expect different default behavior.
  • Utilize this node to simplify complex workflows by converting diverse data types into a uniform boolean format, making it easier to implement conditional logic.

Convert to Boolean Common Errors and Solutions:

Invalid input type

  • Explanation: The input provided is not a type that can be converted to a boolean.
  • Solution: Ensure that the input is a valid data type such as an integer, float, string, or other convertible types.

Conversion failure

  • Explanation: The node failed to convert the input to a boolean due to unexpected input values.
  • Solution: Check the input value for any anomalies or unsupported formats and ensure it is a standard type that can be evaluated for truthiness.

Convert to Boolean Related Nodes

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

Convert to Boolean