From 3958dbcb93f5ef528647ce0d07a73ce9d4ecd85d Mon Sep 17 00:00:00 2001 From: Ardenius Date: Mon, 21 Oct 2024 17:23:36 +0300 Subject: [PATCH 1/2] ARD ComfyUI Ardenius --- ard_data/temp_data.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 ard_data/temp_data.json diff --git a/ard_data/temp_data.json b/ard_data/temp_data.json deleted file mode 100644 index e69de29..0000000 From 30a618e8624ad1f1ad15971061a3466719db51a5 Mon Sep 17 00:00:00 2001 From: Ardenius Date: Mon, 21 Oct 2024 20:49:34 +0300 Subject: [PATCH 2/2] added ARD math nodes ARD ComfyUI Ardenius --- ard_float.py | 41 ++++++++++++++++++++++ ard_integer.py | 41 ++++++++++++++++++++++ ard_integer_to_float.py | 40 +++++++++++++++++++++ ard_math.py | 77 +++++++++++++++++++++++++++++++++++++++++ requirements.txt | 2 +- 5 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 ard_float.py create mode 100644 ard_integer.py create mode 100644 ard_integer_to_float.py create mode 100644 ard_math.py diff --git a/ard_float.py b/ard_float.py new file mode 100644 index 0000000..205318c --- /dev/null +++ b/ard_float.py @@ -0,0 +1,41 @@ +""" +@author: initials AMA +@title: Ardenius +@nickname: Ardenius +@description: ARD float: outputs an float number +""" +# licensed under General Public License v3.0 all rights reserved © 2024 +# ( author initials AMAA Nickname Ardenius contact information ardenius7@gmail.com attribution link https://ko-fi.com/ardenius ) +# ➡️ follow me at https://ko-fi.com/ardenius in the top right corner (follow) +# 📸 Change the mood ! by Visiting my AI Image Gallery +# 🏆 Support me by getting Premium Members only Perks (Premium SD Models, ComfyUI custom nodes, and more to come) +# below code is based upon ComfyUI code licensed under General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.txt by +# contributers found here https://github.com/comfyanonymous/ComfyUI +# thus all code here is released to the user as per the GPL V3.0 terms. + +class ARD_FLOAT: + # def __init__(self): + # pass + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "Fx": ("FLOAT", {"default": 1, "tooltip": "input a float"}), + }, + } + + RETURN_NAMES = ("float",) + RETURN_TYPES = ("FLOAT",) + FUNCTION = "ard_float" + + CATEGORY = "Ardenius" + DESCRIPTION = "ARD float: outputs a float number" + + def ard_integer(self, Fx): + + if not isinstance(Fx, float): + output_float = float(Fx) + else: + output_float = Fx + + return (output_float,) \ No newline at end of file diff --git a/ard_integer.py b/ard_integer.py new file mode 100644 index 0000000..224da8b --- /dev/null +++ b/ard_integer.py @@ -0,0 +1,41 @@ +""" +@author: initials AMA +@title: Ardenius +@nickname: Ardenius +@description: ARD integer: outputs an integer number +""" +# licensed under General Public License v3.0 all rights reserved © 2024 +# ( author initials AMAA Nickname Ardenius contact information ardenius7@gmail.com attribution link https://ko-fi.com/ardenius ) +# ➡️ follow me at https://ko-fi.com/ardenius in the top right corner (follow) +# 📸 Change the mood ! by Visiting my AI Image Gallery +# 🏆 Support me by getting Premium Members only Perks (Premium SD Models, ComfyUI custom nodes, and more to come) +# below code is based upon ComfyUI code licensed under General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.txt by +# contributers found here https://github.com/comfyanonymous/ComfyUI +# thus all code here is released to the user as per the GPL V3.0 terms. + +class ARD_INTEGER: + # def __init__(self): + # pass + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "Ix": ("INT", {"default": 1, "tooltip": "input an integer or float"}), + }, + } + + RETURN_NAMES = ("integer",) + RETURN_TYPES = ("INT",) + FUNCTION = "ard_integer" + + CATEGORY = "Ardenius" + DESCRIPTION = "ARD integer: outputs an integer number" + + def ard_integer(self, Ix): + + if not isinstance(Ix, int): + output_integer = int(Ix) + else: + output_integer = Ix + + return (output_integer,) \ No newline at end of file diff --git a/ard_integer_to_float.py b/ard_integer_to_float.py new file mode 100644 index 0000000..7bdef4b --- /dev/null +++ b/ard_integer_to_float.py @@ -0,0 +1,40 @@ +""" +@author: initials AMA +@title: Ardenius +@nickname: Ardenius +@description: ARD integer: outputs an integer number +""" +# licensed under General Public License v3.0 all rights reserved © 2024 +# ( author initials AMAA Nickname Ardenius contact information ardenius7@gmail.com attribution link https://ko-fi.com/ardenius ) +# ➡️ follow me at https://ko-fi.com/ardenius in the top right corner (follow) +# 📸 Change the mood ! by Visiting my AI Image Gallery +# 🏆 Support me by getting Premium Members only Perks (Premium SD Models, ComfyUI custom nodes, and more to come) +# below code is based upon ComfyUI code licensed under General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.txt by +# contributers found here https://github.com/comfyanonymous/ComfyUI +# thus all code here is released to the user as per the GPL V3.0 terms. + +class ARD_INTEGER_TO_FLOAT: + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "Ix": ("INT", {"default": 1, "tooltip": "input an integer"}), + }, + } + + RETURN_NAMES = ("float",) + RETURN_TYPES = ("FLOAT",) + FUNCTION = "ard_integer_to_float" + + CATEGORY = "Ardenius" + DESCRIPTION = "ARD integer to float: converts an input integer to float" + + def ard_integer_to_float(self, Ix): + + if not isinstance(Ix, float): + output_float = float(Ix) + else: + output_float = Ix + + return (output_float,) \ No newline at end of file diff --git a/ard_math.py b/ard_math.py new file mode 100644 index 0000000..38ee201 --- /dev/null +++ b/ard_math.py @@ -0,0 +1,77 @@ +""" +@author: initials AMA +@title: Ardenius +@nickname: Ardenius +@description: ARD Integer variable +""" +# licensed under General Public License v3.0 all rights reserved © 2024 +# ( author initials AMAA Nickname Ardenius contact information ardenius7@gmail.com attribution link https://ko-fi.com/ardenius ) +# ➡️ follow me at https://ko-fi.com/ardenius in the top right corner (follow) +# 📸 Change the mood ! by Visiting my AI Image Gallery +# 🏆 Support me by getting Premium Members only Perks (Premium SD Models, ComfyUI custom nodes, and more to come) +# below code is based upon ComfyUI code licensed under General Public License v3.0 https://www.gnu.org/licenses/gpl-3.0.txt by +# contributers found here https://github.com/comfyanonymous/ComfyUI +# thus all code here is released to the user as per the GPL V3.0 terms. + +class ARD_MATH: + # def __init__(self): + # pass + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "Ix": ("FLOAT", {"default": 1.0, "min": 0.1, "max": 9999999, "step": 0.1, "tooltip": "input float if you want to input integer use ARD integer to float node"}), + "Iy": ("FLOAT", {"default": 1.0, "min": 0.1, "max": 9999999, "step": 0.1, "tooltip": "input float if you want to input integer use ARD integer to float node"}), + "operation": (["multiply", "divide", "subtract", "add"], {"default": "divide", "tooltip": "pick math operation"}), + }, + } + + RETURN_NAMES = ("result_integer", "result_float") + RETURN_TYPES = ("INT", "FLOAT") + FUNCTION = "ard_math" + + CATEGORY = "Ardenius" + DESCRIPTION = "ARD math node mathematical operations node." + + def ard_math(self, Ix, Iy, operation): + + if isinstance(Ix, int): + Ix = float(Ix) + elif isinstance(Ix, float): + pass + else: + print("ARD math node ERROR: inputs need to be either integer or float") + return 0, 0 + if isinstance(Iy, int): + Iy = float(Iy) + elif isinstance(Iy, float): + pass + else: + print("ARD math node ERROR: inputs need to be either integer or float") + return 0, 0 + + if operation == "multiply": + result_integer = int(Ix * Iy) + elif operation == "divide": + result_integer = int(Ix/Iy) + elif operation == "subtract": + result_integer = int(Ix - Iy) + elif operation == "add": + result_integer = int(Ix + Iy) + else: + print("pick a math operation") + result_integer = 0 + + if operation == "multiply": + result_float = float(Ix * Iy) + elif operation == "divide": + result_float = float(Ix / Iy) + elif operation == "subtract": + result_float = float(Ix - Iy) + elif operation == "add": + result_float = float(Ix + Iy) + else: + print("ARD Math ERROR: pick a math operation") + result_float = 0.0 + + return (result_integer, result_float) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e90b399..8b13789 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -civitai +