Skip to content

Float

Documentation

  • Class name: Float
  • Category: Logic
  • Output node: False

The Float node is designed to process numerical inputs, specifically floating-point numbers, allowing for precise control over decimal values in logical operations or calculations.

Input types

Required

  • value
    • Defines the floating-point number to be processed. This input is crucial for determining the node's operation, affecting the precision and outcome of calculations.
    • Comfy dtype: FLOAT
    • Python dtype: float

Output types

  • FLOAT
    • Comfy dtype: FLOAT
    • Outputs the processed floating-point number, maintaining the precision specified in the input.
    • Python dtype: float

Usage tips

Source code

class Float:
    @classmethod
    def INPUT_TYPES(s):
        return {
            "required": {"value": ("FLOAT", {"default": 0, "step": 0.01})},
        }

    RETURN_TYPES = ("FLOAT",)

    RETURN_NAMES = ("FLOAT",)

    FUNCTION = "execute"

    CATEGORY = "Logic"

    def execute(self, value):
        return (value,)