- Created FloatToIntNode for converting float values to integers with rounding options. - Created IntToFloatNode for converting integer values to floats. - Introduced NODE_CLASS_MAPPINGS to aggregate conversion nodes. - Added .gitignore to exclude __pycache__ directories.
20 lines
444 B
Python
20 lines
444 B
Python
class IntToFloatNode:
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
return {
|
|
"required": {
|
|
"int_value": ("INT", {"default": 0}),
|
|
}
|
|
}
|
|
|
|
RETURN_TYPES = ("FLOAT",)
|
|
RETURN_NAMES = ("float_value",)
|
|
FUNCTION = "cast_to_float"
|
|
CATEGORY = "Custom"
|
|
|
|
def cast_to_float(self, int_value):
|
|
return (float(int_value),)
|
|
|
|
NODE_CLASS_MAPPINGS = {
|
|
"IntToFloat": IntToFloatNode
|
|
} |