Files
Dan The Monk b7cb1796cb Add initial implementations for type conversion nodes
- 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.
2025-07-04 09:02:11 -07:00

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
}