mirror of
https://github.com/tusharbhutt/Endless-Nodes.git
synced 2026-03-21 20:42:12 -03:00
String/Numeric to numeric/string nodes fixed
This commit is contained in:
27
README.md
27
README.md
@@ -10,7 +10,13 @@ Some basic custom nodes for the ComfyUI user interface for Stable Diffusion. Fe
|
|||||||
|
|
||||||
When using the [ComfyUI](https://github.com/comfyanonymous/ComfyUI) interface for [Stable Diffusion](https://github.com/Stability-AI/stablediffusion), I sometimes find that the standard nodes and the many, many, many custom nodes out there don't work the way I want them to, or how I think they do.
|
When using the [ComfyUI](https://github.com/comfyanonymous/ComfyUI) interface for [Stable Diffusion](https://github.com/Stability-AI/stablediffusion), I sometimes find that the standard nodes and the many, many, many custom nodes out there don't work the way I want them to, or how I think they do.
|
||||||
|
|
||||||
Rightly or wrongly, I am pretending to teach myself a bit of Python to get some nodes up and running to do what I'd like. There are no promises that these nodes will work for you or that I will maintain them. Feel free to do with them as you wish, according to the license model.
|
Rightly or wrongly, I am pretending to teach myself a bit of Python to get some nodes up and running to do what I'd like. Yes, I am using ChatGPT, and yes I am a glutton for punishment. There are no promises that these nodes will work for you or that I will maintain them. Feel free to do with them as you wish, according to the license model.
|
||||||
|
|
||||||
|
|
||||||
|
**UPDATE: Oct 4, 2023**
|
||||||
|
|
||||||
|
+ Squished the bugs in the numeric to numerical and string nodes. Special thanks to [chrisgoringe](https://github.com/chrisgoringe) for some vital insight into correcting messy commas in the tuples for the converter nodes, much appreciated!
|
||||||
|
+ Added nodes to convert from string to numeric values, with some basic error checking.
|
||||||
|
|
||||||
**UPDATE: Oct 3, 2023**
|
**UPDATE: Oct 3, 2023**
|
||||||
|
|
||||||
@@ -49,18 +55,18 @@ In Windows, you can then right-click to start a command prompt and type:
|
|||||||
|
|
||||||
You can also get the nodes via the [ComfyUI Manager](https://github.com/ltdrdata/ComfyUI-Manager)
|
You can also get the nodes via the [ComfyUI Manager](https://github.com/ltdrdata/ComfyUI-Manager)
|
||||||
|
|
||||||
**NOTE: Requires CLIP and Pytorch-Lightning for the Aesthetic Scorer and ImageReward for my take on the Image Reward node scorer. I've added them in the requirement file but if it doesn't work, you will need to download manually**
|
**NOTE: Requires CLIP and Pytorch-Lightning for the Aesthetic Scorer and ImageReward for my take on the Image Reward node scorer. Also require colorama for error messages to console. I've added them in the requirement file but if it doesn't work, you will need to download manually**
|
||||||
|
|
||||||
## Node List
|
## Node List
|
||||||
|
|
||||||
## Endless Image Saver
|
## Endless Image Saver
|
||||||
|
|
||||||
This is why I tried my hand ay Python in the first place! There are many, many, many, good image saver nodes out there, so why one more? Well:
|
This is why I tried my hand at Python in the first place! There are many, many, many, good image saver nodes out there, so why one more? Well:
|
||||||
|
|
||||||
+ The default saver does not save to UNC in Windows
|
+ The default saver does not save to UNC in Windows, even if you try to put it in the extra paths YAML file
|
||||||
+ Some savers will allow you to save to UNC but have built-in folder formats
|
+ Some savers will allow you to save to UNC but have restricted built-in folder formats
|
||||||
+ You can cobble some savers to save an image together with a text file, but the timestamp on the text file tends to be 2-3 seconds off from the image
|
+ You can cobble some savers to save an image together with a text file, but the timestamp on the text file tends to be 2-3 seconds off from the image
|
||||||
+ No saver I know of lets you save the JSON file to a completely different folder
|
+ No saver I know of lets you save the JSON file to a **completely different folder**
|
||||||
|
|
||||||
So… this node will allow you to save your image file wherever you want, with full support for standard [Python date and time conventions]( https://docs.python.org/2/library/time.html#time.sleep), and you can save the JSON file somewhere else.
|
So… this node will allow you to save your image file wherever you want, with full support for standard [Python date and time conventions]( https://docs.python.org/2/library/time.html#time.sleep), and you can save the JSON file somewhere else.
|
||||||
|
|
||||||
@@ -74,7 +80,7 @@ Does it work... ?
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
See, it works!
|
JSONs to the left of me, images to the right of me, and here I am stuck in the midle with you! It works!
|
||||||
|
|
||||||
## Aesthetic Scorer
|
## Aesthetic Scorer
|
||||||
|
|
||||||
@@ -178,7 +184,7 @@ The author expressly disclaims any liability for any images you create using the
|
|||||||
|
|
||||||
## Disclaimer
|
## Disclaimer
|
||||||
|
|
||||||
These nodes may or may not be maintained. They work on my system but may not on yours.
|
These nodes may or may not be maintained. They work on my system but may not on yours. Feel free to send in a bug report if you find one!
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
@@ -194,4 +200,7 @@ These nodes may or may not be maintained. They work on my system but may not on
|
|||||||
|
|
||||||
+[Mikey nodes](https://github.com/bash-j/mikey_nodes )to grab code snippet to pass scoring metadata to image
|
+[Mikey nodes](https://github.com/bash-j/mikey_nodes )to grab code snippet to pass scoring metadata to image
|
||||||
|
|
||||||
# Took some base code from the [WAS save image node](https://github.com/WASasquatch/was-node-suite-comfyui) to repurpose it
|
+ Took some base code from the [WAS save image node](https://github.com/WASasquatch/was-node-suite-comfyui) to repurpose it
|
||||||
|
|
||||||
|
+ # Thanks to [chrisgoringe](https://github.com/chrisgoringe) for some vital insgiht into correcting mesy commas in the tuples for the converter nodes, much appreciated!
|
||||||
|
#
|
||||||
61
__init__.py
61
__init__.py
@@ -1,8 +1,8 @@
|
|||||||
"""
|
"""
|
||||||
@author: BiffMunky
|
@author: BiffMunky
|
||||||
@title: Endless ️🌊🌠 Node 🌌
|
@title: Endless ️🌊✨ Nodes
|
||||||
@nickname: ♾️🌊🌠
|
@nickname: ♾️🌊✨
|
||||||
@description: A small set of nodes I created for various numerical and text inputs. Features switches for text and numbers, parameter collection nodes, and two aesthetic scoring models.
|
@description: A small set of nodes I created for various numerical and text inputs. Features image saver with ability to have JSON saved to separate folder, parameter collection nodes, two aesthetic scoring models, switches for text and numbers, and conversion of string to numeric and vice versa.
|
||||||
"""
|
"""
|
||||||
from .endless_nodes import *
|
from .endless_nodes import *
|
||||||
|
|
||||||
@@ -23,19 +23,54 @@ NODE_CLASS_MAPPINGS = {
|
|||||||
"Endless Nodes Float to Integer": EndlessNode_FloattoInt,
|
"Endless Nodes Float to Integer": EndlessNode_FloattoInt,
|
||||||
"Endless Nodes Float to Number": EndlessNode_FloattoNum,
|
"Endless Nodes Float to Number": EndlessNode_FloattoNum,
|
||||||
"Endless Nodes Float to String": EndlessNode_FloattoString,
|
"Endless Nodes Float to String": EndlessNode_FloattoString,
|
||||||
"Endless Nodes Number to Float": EndlessNode_NumtoFloat,
|
"Endless Nodes Float to X": EndlessNode_FloattoX,
|
||||||
"Endless Nodes Number to Integer": EndlessNode_NumtoInt,
|
|
||||||
"Endless Nodes Number to String": EndlessNode_NumtoString,
|
|
||||||
"Endless Nodes Integer to Float": EndlessNode_InttoFloat,
|
"Endless Nodes Integer to Float": EndlessNode_InttoFloat,
|
||||||
"Endless Nodes Integer to Number": EndlessNode_InttoNum,
|
"Endless Nodes Integer to Number": EndlessNode_InttoNum,
|
||||||
"Endless Nodes Integer to String": EndlessNode_InttoString,
|
"Endless Nodes Integer to String": EndlessNode_InttoString,
|
||||||
# "Endless Nodes Float to X": EndlessNode_FloattoX,
|
"Endless Nodes Integer to X": EndlessNode_InttoX,
|
||||||
# "Endless Nodes Integer to X": EndlessNode_InttoX,
|
"Endless Nodes Number to Float": EndlessNode_NumtoFloat,
|
||||||
# "Endless Nodes Number to X": EndlessNode_NumtoX,
|
"Endless Nodes Number to Integer": EndlessNode_NumtoInt,
|
||||||
|
"Endless Nodes Number to String": EndlessNode_NumtoString,
|
||||||
|
"Endless Nodes Number to X": EndlessNode_NumtoX,
|
||||||
|
"Endless Nodes String to Float": EndlessNode_StringtoFloat,
|
||||||
|
"Endless Nodes String to Integer": EndlessNode_StringtoInt,
|
||||||
|
"Endless Nodes String to Num": EndlessNode_StringtoNum,
|
||||||
|
"Endless Nodes String to X": EndlessNode_StringtoX,
|
||||||
}
|
}
|
||||||
|
|
||||||
__all__ = ['NODE_CLASS_MAPPINGS']
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||||
|
"Endless Nodes Six Input Text Switch" : "Endless 🌊✨ Six Input Text Switch",
|
||||||
|
"Endless Nodes Eight Input Text Switch": "Endless 🌊✨ Eight Input Text Switch",
|
||||||
|
"Endless Nodes Six Integer IO Switch": "Endless 🌊✨ Six Integer IO Switch",
|
||||||
|
"Endless Nodes Six Integer IO Widget": "Endless 🌊✨ Six Integer IO Widget",
|
||||||
|
"Endless Nodes Parameterizer": "Endless 🌊✨ Parameterizer",
|
||||||
|
"Endless Nodes Parameterizer & Prompts": "Endless 🌊✨ Parameterizer & Prompts",
|
||||||
|
"Endless Nodes Combo Parameterizer": "Endless 🌊✨ Combo Parameterizer",
|
||||||
|
"Endless Nodes Combo Parameterizer & Prompts": "Endless 🌊✨ Combo Parameterizer & Prompts",
|
||||||
|
"Endless Nodes Image Saver with JSON": "Endless 🌊✨ Image Saver with JSON",
|
||||||
|
"Endless Nodes Aesthetic Scoring": "Endless 🌊✨ Aesthetic Scoring",
|
||||||
|
# "Endless Nodes Aesthetic Scoring Auto": "Endless 🌊✨ Aesthetic Scoring Auto",
|
||||||
|
"Endless Nodes Image Reward": "Endless 🌊✨ Image Reward",
|
||||||
|
# "Endless Nodes Image Reward Auto": "Endless 🌊✨ Image Reward Auto",
|
||||||
|
"Endless Nodes Float to Integer": "Endless 🌊✨ Float to Integer",
|
||||||
|
"Endless Nodes Float to Number": "Endless 🌊✨ Float to Number",
|
||||||
|
"Endless Nodes Float to String": "Endless 🌊✨ Float to String",
|
||||||
|
"Endless Nodes Float to X": "Endless 🌊✨ Float to X",
|
||||||
|
"Endless Nodes Integer to Float": "Endless 🌊✨ Integer to Float",
|
||||||
|
"Endless Nodes Integer to Number": "Endless 🌊✨ Integer to Number",
|
||||||
|
"Endless Nodes Integer to String": "Endless 🌊✨ Integer to String",
|
||||||
|
"Endless Nodes Integer to X": "Endless 🌊✨ Integer to X",
|
||||||
|
"Endless Nodes Number to Float": "Endless 🌊✨ Number to Float",
|
||||||
|
"Endless Nodes Number to Integer": "Endless 🌊✨ Number to Integer",
|
||||||
|
"Endless Nodes Number to String": "Endless 🌊✨ Number to String",
|
||||||
|
"Endless Nodes Number to X": "Endless 🌊✨ Number to X",
|
||||||
|
"Endless Nodes String to Float": "Endless 🌊✨ String to Float",
|
||||||
|
"Endless Nodes String to Integer": "Endless 🌊✨ String to Integer",
|
||||||
|
"Endless Nodes String to Num": "Endless 🌊✨ String to Num",
|
||||||
|
"Endless Nodes String to X": "Endless 🌊✨ String to X",
|
||||||
|
}
|
||||||
|
#Heh, doesn't seem to work :(
|
||||||
|
|
||||||
print("\033[36m 🌌 An Endless Sea of Stars Custom Nodes 🌌 \033[33mreV0.28 \033[34m: \033[92mLoaded\033[0m")
|
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
|
||||||
|
|
||||||
|
print("\033[36m An Endless Sea of Stars Custom Nodes V0.31 \033[34m: \033[92mLoaded\033[0m")
|
||||||
@@ -1,18 +1,20 @@
|
|||||||
Oct 3/23: 0.29- Save Image module added, saves images and JSON to separate folder if requested
|
Oct 04/23, V0.31: Release of V0.28 functionality (int, float, num to X), added String to X, code cleanup, vanity node renaming and recategorization
|
||||||
Sep 28/23: 0.28 - Unreleased - Added Variable types to X
|
Oct 04/23, V0.30: Squished bugs in the various X to X nodes
|
||||||
Sep 28/23: 0.27 - Unreleased - Corrected scoring nodes to actually add the value of the score into the image metadata .... still goobered!
|
Oct 03/23, V0.29: Save Image module added, saves images and JSON to separate folder if requested
|
||||||
Sep 24/23: 0.26 - Unreleased - starting to correct scoring to get to image metadata
|
Sep 28/23, V0.28: (UNRELEASED) Added Variable types to X
|
||||||
Sep 24/23: 0.25 - Added various X to String Nodes
|
Sep 28/23, V0.27: (UNRELEASED) Corrected scoring nodes to actually add the value of the score into the image metadata .... still goobered!
|
||||||
Sep 24/23: 0.24 - Added In Image Reward scoring model with a single node to load model and output standard deviation and scoring via number or string nodes
|
Sep 24/23, V0.26: (UNRELEASED) starting to correct scoring to get to image metadata
|
||||||
Sep 24/23: 0.23 - Rework Aesthetic Score model and integrate it into single node to display score, added a requirements file
|
Sep 24/23, V0.25: Added various X to String Nodes
|
||||||
Sep 23/23: 0.22 - Unreleased, convert ImageReward output to base ten score
|
Sep 24/23, V0.24: Added In Image Reward scoring model with a single node to load model and output standard deviation and scoring via number or string nodes
|
||||||
Sep 22/23: 0.21 - Unreleased, recategorized nodes into submenus, added some vanity coding to the node names, changed the ComfyUI manager header text
|
Sep 24/23, V0.23: Rework Aesthetic Score model and integrate it into single node to display score, added a requirements file
|
||||||
Sep 21/23: 0.20 - Unreleased, skeleton for save image
|
Sep 23/23, V0.22: (UNRELEASED) Convert ImageReward output to base ten score
|
||||||
Sep 21/23: 0.19 - Unreleased attempt for basic display nodes
|
Sep 22/23, V0.21: (UNRELEASED) Introduced aestheticscore, recategorized nodes into submenus, added some vanity coding to the node names, changed the ComfyUI manager header text
|
||||||
Sep 20/23: 0.16 - Added Eight Input Number String
|
Sep 21/23, V0.20: (UNRELEASED) Skeleton for save image
|
||||||
Sep 18/23: 0.15 - Added Combo Parameterizers to reduce number of nodes, allows for common resolution parameters to go to both pos/neg CLIP encode and adds separate pos/neg aesthetic score. Also has a version with pos/neg prompts
|
Sep 21/23, V0.19: (UNRELEASED) Attempt for basic display nodes
|
||||||
Sep 18/23: 0.13 - Fixed Typo, added Paramaterizer with Prompt (unreleased to GitHub)
|
Sep 20/23, V0.16: Added Eight Input Number String
|
||||||
Sep 18/23: 0.12 - Added "Parameterizer", allows for parameters to be added to CLIP Encode
|
Sep 18/23, V0.15: Added Combo Parameterizers to reduce number of nodes, allows for common resolution parameters to go to both pos/neg CLIP encode and adds separate pos/neg aesthetic score. Also has a version with pos/neg prompts
|
||||||
Sep 15/23: 0.10 - Added Six Input Number Widget, first release to GitHub
|
Sep 18/23, V0.13: Fixed typos, added Paramaterizer with Prompt (unreleased to GitHub)
|
||||||
Sep 12/23: 0.05 - Added Six Input Number String
|
Sep 18/23, V0.12: Added "Parameterizer", allows for parameters to be added to CLIP Encode
|
||||||
Sep 8/23: Version 0.0 - Basic Flow for Six Input Text Switch
|
Sep 15/23, V0.10: Added Six Input Number Widget, first release to GitHub
|
||||||
|
Sep 12/23, V0.05: Added Six Input Number String
|
||||||
|
Sep 08/23, V0.00: Basic Flow for Six Input Text Switch
|
||||||
|
|||||||
377
endless_nodes.py
377
endless_nodes.py
@@ -1,26 +1,37 @@
|
|||||||
"""
|
"""
|
||||||
@author: BiffMunky
|
@author: BiffMunky
|
||||||
@title: 🌌 An Endless Sea of Stars Node 🌌
|
@title: Endless ️🌊✨ Nodes
|
||||||
@nickname: 🌌 Endless Nodes 🌌
|
@nickname: ♾️🌊✨
|
||||||
@description: A small set of nodes I created for various numerical and text inputs. Features switches for text and numbers, parameter collection nodes, and two aesthetic scoring models.
|
@description: A small set of nodes I created for various numerical and text inputs. Features image saver with ability to have JSON saved to separate folder, parameter collection nodes, two aesthetic scoring models, switches for text and numbers, and conversion of string to numeric and vice versa.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#0.29 - Save Image module added, saves images and JSON to separate folder if requested
|
|
||||||
#0.28 - Unreleased - Added Variable types to X
|
|
||||||
#0.27 - Unreleased - Corrected scoring nodes to actually add the value of the score into the image metadata .... still goobered!
|
|
||||||
#0.26 - Unreleased - starting to correct scoring to get to image metadata
|
|
||||||
#0.25 - Added various X to String Nodes
|
|
||||||
#0.24 - Image reward node added
|
|
||||||
#0.23 - Aesthetic Scorer added
|
|
||||||
#0.22 Unreleased - intro'd aestheticscore
|
|
||||||
#0.21 unreleased -- trying for display nodes
|
|
||||||
#0.20 sorted categories of nodes
|
|
||||||
|
|
||||||
#----------------------------------------------
|
#----------------------------------------------
|
||||||
# Endless Sea of Stars Custom Node Collection
|
# Endless Sea of Stars Custom Node Collection
|
||||||
#https://github.com/tusharbhutt/Endless-Nodes
|
#https://github.com/tusharbhutt/Endless-Nodes
|
||||||
#----------------------------------------------
|
#----------------------------------------------
|
||||||
#
|
#
|
||||||
|
# Oct 04/23, V0.31: Release of V0.28 functionality (int, float, num to X), added String to X, code cleanup, vanity node renaming and recategorization
|
||||||
|
# Oct 04/23, V0.30: Squished bugs in the various X to X nodes
|
||||||
|
# Oct 03/23, V0.29: Save Image module added, saves images and JSON to separate folder if requested
|
||||||
|
# Sep 28/23, V0.28: (UNRELEASED) Added Variable types to X
|
||||||
|
# Sep 28/23, V0.27: (UNRELEASED) Corrected scoring nodes to actually add the value of the score into the image metadata .... still goobered!
|
||||||
|
# Sep 24/23, V0.26: (UNRELEASED) starting to correct scoring to get to image metadata
|
||||||
|
# Sep 24/23, V0.25: Added various X to String Nodes
|
||||||
|
# Sep 24/23, V0.24: Added In Image Reward scoring model with a single node to load model and output standard deviation and scoring via number or string nodes
|
||||||
|
# Sep 24/23, V0.23: Rework Aesthetic Score model and integrate it into single node to display score, added a requirements file
|
||||||
|
# Sep 23/23, V0.22: (UNRELEASED) Convert ImageReward output to base ten score
|
||||||
|
# Sep 22/23, V0.21: (UNRELEASED) Introduced aestheticscore, recategorized nodes into submenus, added some vanity coding to the node names, changed the ComfyUI manager header text
|
||||||
|
# Sep 21/23, V0.20: (UNRELEASED) Skeleton for save image
|
||||||
|
# Sep 21/23, V0.19: (UNRELEASED) Attempt for basic display nodes
|
||||||
|
# Sep 20/23, V0.16: Added Eight Input Number String
|
||||||
|
# Sep 18/23, V0.15: Added Combo Parameterizers to reduce number of nodes, allows for common resolution parameters to go to both pos/neg CLIP encode and adds separate pos/neg aesthetic score. Also has a version with pos/neg prompts
|
||||||
|
# Sep 18/23, V0.13: Fixed typos, added Paramaterizer with Prompt (unreleased to GitHub)
|
||||||
|
# Sep 18/23, V0.12: Added "Parameterizer", allows for parameters to be added to CLIP Encode
|
||||||
|
# Sep 15/23, V0.10: Added Six Input Number Widget, first release to GitHub
|
||||||
|
# Sep 12/23, V0.05: Added Six Input Number String
|
||||||
|
# Sep 08/23, V0.00: Basic Flow for Six Input Text Switch
|
||||||
|
|
||||||
#______________________________________________________________________________________________________________________________________________________________
|
#______________________________________________________________________________________________________________________________________________________________
|
||||||
# IMPORT MODULES BLOCK #
|
# IMPORT MODULES BLOCK #
|
||||||
|
|
||||||
@@ -63,7 +74,7 @@ colorama.init(autoreset=True)
|
|||||||
|
|
||||||
#______________________________________________________________________________________________________________________________________________________________
|
#______________________________________________________________________________________________________________________________________________________________
|
||||||
# "SWITCHES" BLOCK #
|
# "SWITCHES" BLOCK #
|
||||||
|
#
|
||||||
#----------------------------------------------
|
#----------------------------------------------
|
||||||
# Six Text Input Node for selection
|
# Six Text Input Node for selection
|
||||||
|
|
||||||
@@ -92,7 +103,7 @@ class EndlessNode_SixTextInputSwitch:
|
|||||||
RETURN_NAMES = ("Output",)
|
RETURN_NAMES = ("Output",)
|
||||||
|
|
||||||
FUNCTION = "six_text_switch"
|
FUNCTION = "six_text_switch"
|
||||||
CATEGORY = "Endless 🌌/Switches"
|
CATEGORY = "Endless 🌊✨/Switches"
|
||||||
|
|
||||||
def six_text_switch(self, Input, text1=None,text2=None,text3=None,text4=None,text5=None,text6=None):
|
def six_text_switch(self, Input, text1=None,text2=None,text3=None,text4=None,text5=None,text6=None):
|
||||||
|
|
||||||
@@ -140,7 +151,7 @@ class EndlessNode_EightTextInputSwitch:
|
|||||||
RETURN_NAMES = ("Output",)
|
RETURN_NAMES = ("Output",)
|
||||||
|
|
||||||
FUNCTION = "eight_text_switch"
|
FUNCTION = "eight_text_switch"
|
||||||
CATEGORY = "Endless 🌌/Switches"
|
CATEGORY = "Endless 🌊✨/Switches"
|
||||||
|
|
||||||
def eight_text_switch(self,Input,text1=None,text2=None,text3=None,text4=None,text5=None,text6=None,text7=None,text8=None,):
|
def eight_text_switch(self,Input,text1=None,text2=None,text3=None,text4=None,text5=None,text6=None,text7=None,text8=None,):
|
||||||
|
|
||||||
@@ -188,7 +199,7 @@ class EndlessNode_SixIntIOSwitch:
|
|||||||
RETURN_NAMES = ("INT1","INT2","INT3","INT4","INT5","INT6",)
|
RETURN_NAMES = ("INT1","INT2","INT3","INT4","INT5","INT6",)
|
||||||
|
|
||||||
FUNCTION = "six_intIO_switch"
|
FUNCTION = "six_intIO_switch"
|
||||||
CATEGORY = "Endless 🌌/Switches"
|
CATEGORY = "Endless 🌊✨/Switches"
|
||||||
|
|
||||||
def six_intIO_switch(self, Input, INT1=0, INT2=0, INT3=0, INT4=0, INT5=0, INT6=0):
|
def six_intIO_switch(self, Input, INT1=0, INT2=0, INT3=0, INT4=0, INT5=0, INT6=0):
|
||||||
|
|
||||||
@@ -230,7 +241,7 @@ class EndlessNode_SixIntIOWidget:
|
|||||||
RETURN_NAMES = ("INT1","INT2","INT3","INT4","INT5","INT6",)
|
RETURN_NAMES = ("INT1","INT2","INT3","INT4","INT5","INT6",)
|
||||||
FUNCTION = "six_int_widget"
|
FUNCTION = "six_int_widget"
|
||||||
|
|
||||||
CATEGORY = "Endless 🌌/Switches"
|
CATEGORY = "Endless 🌊✨/Switches"
|
||||||
|
|
||||||
|
|
||||||
def six_int_widget(self,int1,int2,int3,int4,int5,int6):
|
def six_int_widget(self,int1,int2,int3,int4,int5,int6):
|
||||||
@@ -272,7 +283,7 @@ class EndlessNode_XLParameterizerPrompt:
|
|||||||
|
|
||||||
FUNCTION = "ParameterizerPrompt"
|
FUNCTION = "ParameterizerPrompt"
|
||||||
|
|
||||||
CATEGORY = "Endless 🌌/Parameters"
|
CATEGORY = "Endless 🌊✨/Parameters"
|
||||||
|
|
||||||
def ParameterizerPrompt(self,base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_ascore,endlessG,endlessL):
|
def ParameterizerPrompt(self,base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_ascore,endlessG,endlessL):
|
||||||
return(base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_ascore,endlessG,endlessL)
|
return(base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_ascore,endlessG,endlessL)
|
||||||
@@ -303,7 +314,7 @@ class EndlessNode_XLParameterizer:
|
|||||||
RETURN_NAMES = ("Base Width","Base Height","Base Cropped Width","Base Cropped Height","Base Target Width","Base Target Height","Refiner Width","Refiner Height","Refiner Aesthetic Score",)
|
RETURN_NAMES = ("Base Width","Base Height","Base Cropped Width","Base Cropped Height","Base Target Width","Base Target Height","Refiner Width","Refiner Height","Refiner Aesthetic Score",)
|
||||||
FUNCTION = "Parameterizer"
|
FUNCTION = "Parameterizer"
|
||||||
|
|
||||||
CATEGORY = "Endless 🌌/Parameters"
|
CATEGORY = "Endless 🌊✨/Parameters"
|
||||||
|
|
||||||
|
|
||||||
def Parameterizer(self,base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_ascore):
|
def Parameterizer(self,base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_ascore):
|
||||||
@@ -344,7 +355,7 @@ class EndlessNode_ComboXLParameterizerPrompt:
|
|||||||
|
|
||||||
FUNCTION = "ComboParameterizerPrompt"
|
FUNCTION = "ComboParameterizerPrompt"
|
||||||
|
|
||||||
CATEGORY = "Endless 🌌/Parameters"
|
CATEGORY = "Endless 🌊✨/Parameters"
|
||||||
|
|
||||||
def ComboParameterizerPrompt(self,base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_pascore,refiner_nascore,PendlessG,PendlessL,NendlessG,NendlessL):
|
def ComboParameterizerPrompt(self,base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_pascore,refiner_nascore,PendlessG,PendlessL,NendlessG,NendlessL):
|
||||||
return(base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_pascore,refiner_nascore,PendlessG,PendlessL,NendlessG,NendlessL)
|
return(base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_pascore,refiner_nascore,PendlessG,PendlessL,NendlessG,NendlessL)
|
||||||
@@ -376,7 +387,7 @@ class EndlessNode_ComboXLParameterizer:
|
|||||||
RETURN_NAMES = ("Base Width","Base Height","Base Cropped Width","Base Cropped Height","Base Target Width","Base Target Height","Refiner Width","Refiner Height","Positive Refiner Aesthetic Score","Negative Refiner Aesthetic Score",)
|
RETURN_NAMES = ("Base Width","Base Height","Base Cropped Width","Base Cropped Height","Base Target Width","Base Target Height","Refiner Width","Refiner Height","Positive Refiner Aesthetic Score","Negative Refiner Aesthetic Score",)
|
||||||
FUNCTION = "ComboParameterizer"
|
FUNCTION = "ComboParameterizer"
|
||||||
|
|
||||||
CATEGORY = "Endless 🌌/Parameters"
|
CATEGORY = "Endless 🌊✨/Parameters"
|
||||||
|
|
||||||
|
|
||||||
def ComboParameterizer(self,base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_pascore, refiner_nascore):
|
def ComboParameterizer(self,base_width,base_height,base_crop_w,base_crop_h,base_target_w,base_target_h,refiner_width,refiner_height,refiner_pascore, refiner_nascore):
|
||||||
@@ -450,7 +461,7 @@ class EndlessNode_Scoring:
|
|||||||
|
|
||||||
RETURN_TYPES = ("NUMBER","IMAGE")
|
RETURN_TYPES = ("NUMBER","IMAGE")
|
||||||
FUNCTION = "calc_score"
|
FUNCTION = "calc_score"
|
||||||
CATEGORY = "Endless 🌌/Scoring"
|
CATEGORY = "Endless 🌊✨/Scoring"
|
||||||
|
|
||||||
def calc_score(self, model_name, image):
|
def calc_score(self, model_name, image):
|
||||||
m_path = folder_paths.folder_names_and_paths["aesthetic"][0]
|
m_path = folder_paths.folder_names_and_paths["aesthetic"][0]
|
||||||
@@ -493,7 +504,7 @@ class EndlessNode_Scoring:
|
|||||||
# RETURN_TYPES = ("NUMBER","IMAGE")
|
# RETURN_TYPES = ("NUMBER","IMAGE")
|
||||||
# FUNCTION = "calc_score"
|
# FUNCTION = "calc_score"
|
||||||
# OUTPUT_NODE = True
|
# OUTPUT_NODE = True
|
||||||
# CATEGORY = "Endless 🌌/Scoring"
|
# CATEGORY = "Endless 🌊✨/Scoring"
|
||||||
|
|
||||||
# def calc_score(self, model_name, image):
|
# def calc_score(self, model_name, image):
|
||||||
# m_path = folder_paths.folder_names_and_paths["aesthetic"][0]
|
# m_path = folder_paths.folder_names_and_paths["aesthetic"][0]
|
||||||
@@ -539,7 +550,7 @@ class EndlessNode_ImageReward:
|
|||||||
RETURN_TYPES = ("FLOAT", "STRING", "FLOAT", "STRING")
|
RETURN_TYPES = ("FLOAT", "STRING", "FLOAT", "STRING")
|
||||||
RETURN_NAMES = ("SCORE_FLOAT", "SCORE_STRING", "VALUE_FLOAT", "VALUE_STRING")
|
RETURN_NAMES = ("SCORE_FLOAT", "SCORE_STRING", "VALUE_FLOAT", "VALUE_STRING")
|
||||||
|
|
||||||
CATEGORY = "Endless 🌌/Scoring"
|
CATEGORY = "Endless 🌊✨/Scoring"
|
||||||
|
|
||||||
FUNCTION = "process_images"
|
FUNCTION = "process_images"
|
||||||
|
|
||||||
@@ -580,7 +591,7 @@ class EndlessNode_ImageRewardAutoScore:
|
|||||||
RETURN_NAMES = ("SCORE_FLOAT", "SCORE_STRING", "VALUE_FLOAT", "VALUE_STRING", "TO_IMAGE")
|
RETURN_NAMES = ("SCORE_FLOAT", "SCORE_STRING", "VALUE_FLOAT", "VALUE_STRING", "TO_IMAGE")
|
||||||
OUTPUT_NODE = True
|
OUTPUT_NODE = True
|
||||||
|
|
||||||
CATEGORY = "Endless 🌌/Scoring"
|
CATEGORY = "Endless 🌊✨/Scoring"
|
||||||
|
|
||||||
FUNCTION = "score_meta"
|
FUNCTION = "score_meta"
|
||||||
|
|
||||||
@@ -634,7 +645,7 @@ class EndlessNode_ImageSaver:
|
|||||||
RETURN_TYPES = ()
|
RETURN_TYPES = ()
|
||||||
FUNCTION = "save_images"
|
FUNCTION = "save_images"
|
||||||
OUTPUT_NODE = True
|
OUTPUT_NODE = True
|
||||||
CATEGORY = "Endless 🌌/IO"
|
CATEGORY = "Endless 🌊✨/IO"
|
||||||
|
|
||||||
def save_images(self, images, filename_prefix="ComfyUI", delimiter="_",
|
def save_images(self, images, filename_prefix="ComfyUI", delimiter="_",
|
||||||
filename_number_padding=4, filename_number_start='false',
|
filename_number_padding=4, filename_number_start='false',
|
||||||
@@ -776,12 +787,12 @@ class EndlessNode_ImageSaver:
|
|||||||
return filename
|
return filename
|
||||||
# ______________________________________________________________________________________________________________________________________________________________
|
# ______________________________________________________________________________________________________________________________________________________________
|
||||||
# CONVERTER NODES BLOCK #
|
# CONVERTER NODES BLOCK #
|
||||||
|
#
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# Float value to Integer
|
# Float to Integer
|
||||||
|
|
||||||
class EndlessNode_FloattoInt:
|
class EndlessNode_FloattoInt:
|
||||||
CATEGORY = "Endless 🌌/Converters"
|
CATEGORY = "Endless 🌊✨/Converters/Float"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
@@ -789,22 +800,20 @@ class EndlessNode_FloattoInt:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
def INPUT_TYPES(cls):
|
||||||
return {
|
return {
|
||||||
"required": {"FloatValue": ("FLOAT", {"default": 0.0},)}
|
"required": {"FloatValue": ("FLOAT", {"default": 0.0})},
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("INT",)
|
RETURN_TYPES = ("INT",)
|
||||||
FUNCTION = "inputfloat"
|
FUNCTION = "inputfloat"
|
||||||
|
|
||||||
def inputfloat(self, FloatValue):
|
def inputfloat(self, FloatValue):
|
||||||
return int(FloatValue,)
|
return (int(FloatValue),)
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# Float value to Number, passes minimum one decimal
|
# Float value to Number. There is no real "Number" function in Python, this is here so that nodes that need a NUMBER can take the FLOAT value
|
||||||
# There is no real "Number" function in Python, this is here so that nodes that need a NUMBER can take the FLOAT value
|
|
||||||
|
|
||||||
class EndlessNode_FloattoNum:
|
class EndlessNode_FloattoNum:
|
||||||
CATEGORY = "Endless 🌌/Converters"
|
CATEGORY = "Endless 🌊✨/Converters/Float"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
@@ -812,21 +821,21 @@ class EndlessNode_FloattoNum:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
def INPUT_TYPES(cls):
|
||||||
return {
|
return {
|
||||||
"required": {"FloatValue": ("FLOAT", {"default": 0.0,}),}
|
"required": {"FloatValue": ("FLOAT", {"default": 0.0})},
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("NUMBER",)
|
RETURN_TYPES = ("NUMBER",)
|
||||||
FUNCTION = "inputfloat"
|
FUNCTION = "inputfloat"
|
||||||
|
|
||||||
def inputfloat(self, FloatValue):
|
def inputfloat(self, FloatValue):
|
||||||
return float(FloatValue,)
|
return (float(FloatValue),)
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# Float value to String, passes one to eight decimals
|
# Float to String,
|
||||||
|
|
||||||
class EndlessNode_FloattoString:
|
class EndlessNode_FloattoString:
|
||||||
CATEGORY = "Endless 🌌/Converters"
|
CATEGORY = "Endless 🌊✨/Converters/Float"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
@@ -834,146 +843,121 @@ class EndlessNode_FloattoString:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
def INPUT_TYPES(cls):
|
||||||
return {
|
return {
|
||||||
"required": {"FloatValue": ("FLOAT", {"default": 0.0,},)}
|
"required": {"FloatValue": ("FLOAT", {"default": 0.0})},
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("STRING",)
|
RETURN_TYPES = ("STRING")
|
||||||
FUNCTION = "inputfloat"
|
FUNCTION = "inputfloat"
|
||||||
|
|
||||||
def inputfloat(self, FloatValue):
|
def inputfloat(self, FloatValue):
|
||||||
if isinstance(FloatValue, float):
|
return(str(FloatValue),)
|
||||||
formatted_value = f'{FloatValue:.1f}' if FloatValue.is_integer() else f'{FloatValue:.8f}'
|
|
||||||
return str((formatted_value),)
|
|
||||||
elif isinstance(FloatValue, int):
|
|
||||||
#Convert integer to float and then format
|
|
||||||
formatted_value = f'{float(FloatValue):.1f}'
|
|
||||||
return str((formatted_value),)
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
#Try to convert to float, and then format
|
|
||||||
float_value = float(FloatValue)
|
|
||||||
formatted_value = f'{float_value:.1f}' if float_value.is_integer() else f'{float_value:.8f}'
|
|
||||||
return str((formatted_value),)
|
|
||||||
except ValueError:
|
|
||||||
return ("Not a valid float",)
|
|
||||||
|
|
||||||
|
# ----------------------------------------------
|
||||||
|
# Float value to X
|
||||||
|
|
||||||
# # ---------------------------------------------- NEED TO FIX
|
class EndlessNode_FloattoX:
|
||||||
# # Float value to X
|
CATEGORY = "Endless 🌊✨/Converters/Float"
|
||||||
|
|
||||||
# class EndlessNode_FloattoX:
|
def __init__(self):
|
||||||
# CATEGORY = "Endless 🌌/Converters"
|
pass
|
||||||
|
|
||||||
# def __init__(self):
|
@classmethod
|
||||||
# pass
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {"FloatValue": ("FLOAT", {"default": 0.0})},
|
||||||
|
}
|
||||||
|
|
||||||
# @classmethod
|
RETURN_TYPES = ("INT", "NUMBER","STRING")
|
||||||
# def INPUT_TYPES(cls):
|
FUNCTION = "inputfloat"
|
||||||
# return {
|
|
||||||
# "required": {
|
|
||||||
# "FloatValue": ("FLOAT", {"default": 0, "min": -8675309362436420, "max": 8675309362436420}),
|
|
||||||
# },
|
|
||||||
# }
|
|
||||||
|
|
||||||
# RETURN_TYPES = ("INT", "NUMBER", "STR")
|
|
||||||
# FUNCTION = "return_constant_number"
|
|
||||||
|
|
||||||
# def return_constant_number(self, FloatValue):
|
|
||||||
|
|
||||||
# # Return number
|
|
||||||
# return (int(FloatValue), (FloatValue), str(FloatValue))
|
|
||||||
|
|
||||||
|
def inputfloat(self, FloatValue):
|
||||||
|
return(int(FloatValue), float(FloatValue),str(FloatValue),)
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# Integer to Float
|
# Integer to Float
|
||||||
|
|
||||||
class EndlessNode_InttoFloat:
|
class EndlessNode_InttoFloat:
|
||||||
CATEGORY = "Endless 🌌/Converters"
|
CATEGORY = "Endless 🌊✨/Converters/Int"
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
def INPUT_TYPES(cls):
|
||||||
return {
|
return {
|
||||||
"required": {"IntegerValue": ("INT",),}
|
"required": {"IntegerValue": ("INT", {"default": 0})},
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("FLOAT",)
|
RETURN_TYPES = ("FLOAT",)
|
||||||
FUNCTION = "inputint"
|
FUNCTION = "inputint"
|
||||||
|
|
||||||
def inputint(self, IntegerValue):
|
def inputint(self, IntegerValue):
|
||||||
return int((IntegerValue),)
|
return (int(IntegerValue),)
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# Integer to Number
|
# Integer to Number (for compatability purposes)
|
||||||
|
|
||||||
class EndlessNode_InttoNum:
|
class EndlessNode_InttoNum:
|
||||||
CATEGORY = "Endless 🌌/Converters"
|
CATEGORY = "Endless 🌊✨/Converters/Int"
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
def INPUT_TYPES(cls):
|
||||||
return {
|
return {
|
||||||
"required": {"IntegerValue": ("INT",),}
|
"required": {"IntegerValue": ("INT", {"default": 0})},
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("NUMBER",)
|
RETURN_TYPES = ("NUMBER")
|
||||||
FUNCTION = "inputint"
|
FUNCTION = "inputint"
|
||||||
|
|
||||||
def inputint(self, IntegerValue):
|
def inputint(self, IntegerValue):
|
||||||
return int((IntegerValue),)
|
return (int(IntegerValue),)
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# Integer to String
|
# Integer to String
|
||||||
|
|
||||||
class EndlessNode_InttoString:
|
class EndlessNode_InttoString:
|
||||||
CATEGORY = "Endless 🌌/Converters"
|
CATEGORY = "Endless 🌊✨/Converters/Int"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
def INPUT_TYPES(cls):
|
||||||
return {
|
return {
|
||||||
"required": {"IntegerValue": ("INT",{"default": 0,},)}
|
"required": {"IntegerValue": ("INT", {"default": 0})},
|
||||||
}
|
}
|
||||||
RETURN_TYPES = ("STRING",)
|
RETURN_TYPES = ("STRING")
|
||||||
FUNCTION = "inputint"
|
FUNCTION = "inputint"
|
||||||
|
|
||||||
def inputint(self, IntegerValue):
|
def inputint(self, IntegerValue):
|
||||||
return str((IntegerValue),)
|
return (str(IntegerValue),)
|
||||||
|
|
||||||
# # ---------------------------------------------- NOT ORKING, NEED TO FIX
|
|
||||||
# # Integer value to X
|
|
||||||
|
|
||||||
# class EndlessNode_InttoX:
|
# ----------------------------------------------
|
||||||
# CATEGORY = "Endless 🌌/Converters"
|
#Integer to X
|
||||||
|
|
||||||
# def __init__(self):
|
class EndlessNode_InttoX:
|
||||||
# pass
|
CATEGORY = "Endless 🌊✨/Converters/Int"
|
||||||
|
|
||||||
# @classmethod
|
def __init__(self):
|
||||||
# def INPUT_TYPES(cls):
|
pass
|
||||||
# return {
|
|
||||||
# "required": {
|
|
||||||
# "number": ("INT", {"default": 0, "min": -8675309, "max": 8675309}),
|
|
||||||
# },
|
|
||||||
# }
|
|
||||||
|
|
||||||
# RETURN_TYPES = ("FLOAT", "NUMBER", "STR")
|
@classmethod
|
||||||
# FUNCTION = "return_constant_number"
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {"IntegerValue": ("INT", {"default": 0})},
|
||||||
|
}
|
||||||
|
|
||||||
# def return_constant_number(self, number):
|
RETURN_TYPES = ("FLOAT", "NUMBER","STRING")
|
||||||
|
FUNCTION = "inputint"
|
||||||
# # Return number
|
|
||||||
# return (float(number), float(number), str(number))
|
|
||||||
|
|
||||||
|
def inputint(self, IntegerValue):
|
||||||
|
return(float(IntegerValue), float(IntegerValue),str(IntegerValue),)
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# Number to Float
|
# Number to Float
|
||||||
|
|
||||||
class EndlessNode_NumtoFloat:
|
class EndlessNode_NumtoFloat:
|
||||||
CATEGORY = "Endless 🌌/Converters"
|
CATEGORY = "Endless 🌊✨/Converters/Number"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
@@ -988,74 +972,174 @@ class EndlessNode_NumtoFloat:
|
|||||||
FUNCTION = "inputnum"
|
FUNCTION = "inputnum"
|
||||||
|
|
||||||
def inputnum(self, NumberValue):
|
def inputnum(self, NumberValue):
|
||||||
return float((NumberValue),)
|
return (float(NumberValue),)
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# Number to Integer
|
# Number to Integer
|
||||||
|
|
||||||
class EndlessNode_NumtoInt:
|
class EndlessNode_NumtoInt:
|
||||||
CATEGORY = "Endless 🌌/Converters"
|
CATEGORY = "Endless 🌊✨/Converters/Number"
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
def INPUT_TYPES(cls):
|
||||||
return {
|
return {
|
||||||
"required": {"NumberValue": ("NUMBER",),}
|
"required": {
|
||||||
|
"number": ("NUMBER",),}
|
||||||
}
|
}
|
||||||
RETURN_TYPES = ("INT",)
|
|
||||||
FUNCTION = "inputnum"
|
|
||||||
|
|
||||||
def inputnum(self, NumberValue):
|
RETURN_TYPES = ("INT",)
|
||||||
return int((NumberValue),)
|
FUNCTION = "number_to_int"
|
||||||
|
|
||||||
|
def number_to_int(self, number):
|
||||||
|
return (int(number), )
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# Number value to String
|
# Number to String
|
||||||
|
|
||||||
class EndlessNode_NumtoString:
|
class EndlessNode_NumtoString:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
CATEGORY = "Endless 🌌/Converters"
|
CATEGORY = "Endless 🌊✨/Converters/Number"
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {"NumberValue": ("NUMBER",)},
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("STRING")
|
||||||
|
FUNCTION = "inputnum"
|
||||||
|
|
||||||
|
def inputnum(self, NumberValue):
|
||||||
|
return(str(NumberValue),)
|
||||||
|
|
||||||
|
# ----------------------------------------------
|
||||||
|
# Number to X
|
||||||
|
|
||||||
|
class EndlessNode_NumtoX:
|
||||||
|
CATEGORY = "Endless 🌊✨/Converters/Number"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
def INPUT_TYPES(cls):
|
||||||
return {
|
return {
|
||||||
"required": {"NumberValue": ("NUMBER",),}
|
"required": {"NumberValue": ("NUMBER",)},
|
||||||
}
|
}
|
||||||
RETURN_TYPES = ("STRING",)
|
|
||||||
|
RETURN_TYPES = ("FLOAT", "INT", "STRING")
|
||||||
|
RETURN_NAMES = ("FLOAT", "INT", "STRING")
|
||||||
FUNCTION = "inputnum"
|
FUNCTION = "inputnum"
|
||||||
|
|
||||||
def inputnum(self, NumberValue):
|
def inputnum(self, NumberValue):
|
||||||
return str((NumberValue),)
|
return(float(NumberValue), int(NumberValue),str(NumberValue),)
|
||||||
|
|
||||||
# NEED TO FIX STILL
|
|
||||||
# class EndlessNode_NumtoX:
|
|
||||||
# CATEGORY = "Endless 🌌/Converters"
|
|
||||||
|
|
||||||
# def __init__(self):
|
# ----------------------------------------------
|
||||||
# pass
|
# String to Float
|
||||||
|
|
||||||
# @classmethod
|
class EndlessNode_StringtoFloat:
|
||||||
# def INPUT_TYPES(cls):
|
CATEGORY = "Endless 🌊✨/Converters/String"
|
||||||
# return {
|
|
||||||
# "required": {
|
|
||||||
# "number": ("FLOAT", {"default": 0, "min": -8675309362436420, "max": 8675309362436420}),
|
|
||||||
# },
|
|
||||||
# }
|
|
||||||
|
|
||||||
# RETURN_TYPES = ("FLOAT", "INT", "STR")
|
def __init__(self):
|
||||||
# FUNCTION = "return_constant_number"
|
pass
|
||||||
|
|
||||||
# def return_constant_number(self, number):
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {"StringValue": ("STRING", {"default": ""})},
|
||||||
|
}
|
||||||
|
|
||||||
# # Return number
|
RETURN_TYPES = ("FLOAT",)
|
||||||
# return (float(number), int(number), str(number))
|
FUNCTION = "inputstring"
|
||||||
|
|
||||||
|
def inputstring(self, StringValue):
|
||||||
|
try:
|
||||||
|
return(float(StringValue),)
|
||||||
|
except (ValueError, TypeError): # Handle non-numerical input here by returning default value of 0
|
||||||
|
return 0.0
|
||||||
|
|
||||||
|
# ----------------------------------------------
|
||||||
|
# String to Int
|
||||||
|
|
||||||
|
class EndlessNode_StringtoInt:
|
||||||
|
CATEGORY = "Endless 🌊✨/Converters/String"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {"StringValue": ("STRING", {"default": ""})},
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("INT",)
|
||||||
|
FUNCTION = "inputstring"
|
||||||
|
|
||||||
|
def inputstring(self, StringValue):
|
||||||
|
try:
|
||||||
|
return(int(float(StringValue)),) # int(float(x)) in case the user puts in a decimal
|
||||||
|
except (ValueError, TypeError): # Handle non-numerical input here by returning default value of 0
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------
|
||||||
|
# String to Number. There is no real "Number" function in Python, this is here so that nodes that need a NUMBER can take the FLOAT value
|
||||||
|
|
||||||
|
class EndlessNode_StringtoNum:
|
||||||
|
CATEGORY = "Endless 🌊✨/Converters/String"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {"StringValue": ("STRING", {"default": ""})},
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("NUMBER",)
|
||||||
|
FUNCTION = "inputstring"
|
||||||
|
|
||||||
|
def inputstring(self, StringValue):
|
||||||
|
try:
|
||||||
|
return(float(StringValue),)
|
||||||
|
except (ValueError, TypeError): # Handle non-numerical input here by returning default value of 0
|
||||||
|
return 0.0
|
||||||
|
|
||||||
|
# ----------------------------------------------
|
||||||
|
# String to X
|
||||||
|
|
||||||
|
class EndlessNode_StringtoX:
|
||||||
|
CATEGORY = "Endless 🌊✨/Converters/String"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {"StringValue": ("STRING", {"default": ""})},
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("INT", "FLOAT","NUMBER")
|
||||||
|
FUNCTION = "inputstring"
|
||||||
|
|
||||||
|
def inputstring(self, StringValue):
|
||||||
|
try:
|
||||||
|
return(int(float(StringValue)), float(StringValue),float(StringValue),) # int(float(x)) in case the user puts in a decimal
|
||||||
|
except (ValueError, TypeError): # Handle non-numerical input here by returning default value of 0
|
||||||
|
return 0, 0.0, 0.0
|
||||||
|
|
||||||
#______________________________________________________________________________________________________________________________________________________________
|
#______________________________________________________________________________________________________________________________________________________________
|
||||||
# CREDITS #
|
# CREDITS #
|
||||||
|
#
|
||||||
#
|
#
|
||||||
# Comfyroll Custom Nodes for the initial node code layout, coding snippets, and inspiration for the text input and number switches
|
# Comfyroll Custom Nodes for the initial node code layout, coding snippets, and inspiration for the text input and number switches
|
||||||
#
|
#
|
||||||
@@ -1083,13 +1167,14 @@ class EndlessNode_NumtoString:
|
|||||||
#Mikey nodes to grab code snippet to pass scoring metadata to image
|
#Mikey nodes to grab code snippet to pass scoring metadata to image
|
||||||
#
|
#
|
||||||
#https://github.com/bash-j/mikey_nodes
|
#https://github.com/bash-j/mikey_nodes
|
||||||
|
#
|
||||||
# Took some base code from the WAS save image node to repurpose it
|
# Took some base code from the WAS save image node to repurpose it
|
||||||
#
|
#
|
||||||
#https://github.com/WASasquatch/was-node-suite-comfyui
|
#https://github.com/WASasquatch/was-node-suite-comfyui
|
||||||
#--------------------------------------
|
#--------------------------------------
|
||||||
|
#
|
||||||
|
# Special thanks to [chrisgoringe](https://github.com/chrisgoringe) for some vital insight into correcting messy commas in the tuples for the converter nodes, much appreciated!
|
||||||
|
#
|
||||||
|
#######################################################################################
|
||||||
|
|
||||||
|
# CELLAR DWELLERS
|
||||||
######################################################################################## CELLAR DWELLERS
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user