LayerStyle
Run ComfyUI Easily with InstaSD
Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
Available Nodes
LayerUtility: NumberCalculator
Documentation for LayerUtility: Number Calculator Node
Overview
The LayerUtility: Number Calculator node is part of the ComfyUI Layer Style utility library. This node functions as a basic arithmetic and comparison calculator within ComfyUI workflows, allowing users to perform various mathematical operations between two inputs, a and b. The result of these operations is provided in both integer and float formats.
Node Functionality
The primary role of the Number Calculator node is to perform mathematical operations on two given inputs. This node supports a variety of operations, which can be selected based on the user's requirement.
Accepted Inputs
The Number Calculator node accepts the following inputs:
-
a: The first input value. This value can be any numeric type (integer or float).
-
b: The second input value. Similar to
a, this can also be any numeric type. -
operator: This determines the operation to be performed on
aandb. The available operators include:+: Addition-: Subtraction*: Multiplication/: Division**: Exponentiation (raisingato the power ofb)//: Floor Division%: Modulus (remainder of the division)nth_root: Calculates the nth root ofa(araised to the power of 1/b)min: Minimum ofaandbmax: Maximum ofaandb
Produced Outputs
The node provides two outputs upon execution:
-
int: The result as an integer. This is most relevant when whole numbers are expected or required in the workflow.
-
float: The result as a floating-point number, providing a more precise output, particularly useful when dealing with non-integer results.
Usage in ComfyUI Workflows
The LayerUtility: Number Calculator node is flexible enough to be used in numerous scenarios where arithmetic operations are needed. Some possible uses include:
- Data Manipulation: Adjust numerical data or perform calculations as part of a larger dataset processing task.
- Conditional Logic: Use the results in conjunction with other nodes to create condition-based operations.
- Visualization Adjustments: Calculate transformations, scales, or adjustments when dealing with visual elements or coordinate changes.
Special Features and Considerations
-
Zero Division Handling: The division (both regular and floor) operations ensure that an attempt to divide by zero results in an output of zero instead of causing an error. This feature helps maintain robust workflows without unexpected interruptions.
-
Decimal Precision: Outputs are given in both integer and float formats to accommodate varying precision needs, allowing for a flexible workflow integration.
-
Versatile Operator Selection: The node is capable of handling various mathematical operations, simplifying tasks that require arithmetic manipulations without needing multiple nodes.
This comprehensive functionality makes the Number Calculator node a valuable component in creating complex workflows within ComfyUI, enabling precise and efficient calculations as part of broader data and visualization tasks.