ComfyUI Extension: CalculatorPro - Node Suite for ComfyUI
utilitaires pour ComfyUI, conçue pour effectuer des calculs et des conversions
Custom Nodes (0)
README
🧮 CalculatorPro - Node Suite for ComfyUI
A comprehensive suite of utility nodes for ComfyUI, designed to perform scientific calculations, data type conversions, and complex unit conversions directly within your workflows.
This project was born from a simple idea: to integrate powerful and flexible calculation tools into the core of image generation, enabling unprecedented control and automation.
✨ Features
This suite includes a diverse range of nodes, all organized under the main CalculatorPro category in ComfyUI.
Sub-category: Math
- 🧮 Scientific Calculator: A powerful three-input (
a,b,c) tool capable of performing a wide range of operations:- Basic arithmetic (
+,-,*,/). - Power (
^), modulo (mod). - Trigonometric functions (
sin,cos,tan). - Square root, logarithm, absolute value, rounding.
- Comparisons (
min,max).
- Basic arithmetic (
Sub-category: Converters
- 🔧 Universal Converter: The Swiss Army knife of data conversion. Provide any input (
FLOAT,INT,STRING, orBOOLEAN) and get all four types as output. - 💱 Manual Rate Converter: Perfect for currency conversions or any other calculation based on a custom rate. Multiply or divide an amount by an exchange rate.
- 📏 Length Converter: Convert between dozens of units, from millimeters to parsecs, including feet, inches, and nautical miles.
- ⚖️ Mass Converter: Easily switch from grams to tons, including pounds, ounces, and even stones.
- 💧 Volume Converter: Convert liters, cubic meters, gallons, pints, and even kitchen units like tablespoons.
- 💾 Data Converter: Clearly distinguish between SI units (megabyte, 10⁶) and binary units (mebibyte, 2²⁰), from bit to petabyte.
- ⏱️ Time Converter: Convert seconds to years, including hours, months, and even Planck time.
🛠️ Installation
Method 1: Git Clone (Recommended)
- Open a terminal or command prompt.
- Navigate to the
custom_nodesfolder of your ComfyUI installation.cd /path/to/your/ComfyUI/custom_nodes/ - Clone this repository:
(Don't forget to replacegit clone https://github.com/orion4d/Calculator_Pro.githttps://YOUR_GITHUB_URL_HERE.gitwith your repository's actual URL!) - Restart ComfyUI.
Method 2: Manual
- Click the green
<> Codebutton at the top of this page, thenDownload ZIP. - Extract the contents of the ZIP archive.
- Place the resulting folder (e.g.,
scientific_calculator) into thecustom_nodesfolder of your ComfyUI installation. - Restart ComfyUI.
🚀 Usage Examples
The power of these nodes lies in their ability to dynamically drive other parts of your workflow.
Example 1: Controlling a KSampler Parameter
Use the Scientific Calculator to compute a value (e.g., 1 / 3 to get 0.333...). Connect the result (FLOAT) output to the denoise input of a KSampler for precise control.
Example 2: Calculating Image Dimensions
Use the Calculator to determine a width and height (e.g., width = 1024, height = width * 0.75). Then, use the Universal Converter to convert the FLOAT results to INT and connect them to the width and height inputs of an Empty Latent Image node.
Example 3: Converting for Prompts
Use the Length Converter to convert 1.80 (meters) to Pied (ft). Connect the output_str to a node that assembles prompts to dynamically add "a 5.9-foot tall man" to your text.
📄 License
This project is licensed under the MIT License. For more details, see the LICENSE file.