ComfyUI
ComfyUI copied to clipboard
Add Convert Data Type Node
Per my previous PR, I initially created five nodes, though it became obvious that it couldn't work out. I then learned of the existence of Impact Pack's Convert Data Type node, which is what this node is largely based upon. I decided to add more options to the float as per my previous PR had, as well as the ability to also output a combo. Returns null on int and float output if the string cannot be converted to a float.
The main functions this introduces:
- The user is able to choose what rounding type to use on a float or a string representing a float before it is converted to an integer. We are able to choose to just truncate, round, or do banker's rounding on a float.
- The user is able to choose if a float is to be rounded before being converted to a string, and to choose how many decimal points, or to just display the full float.
Mainly, this is meant to be an extremely simple method to convert data types without needing a node for each type to be converted.
- Related: https://github.com/comfyanonymous/ComfyUI/pull/8024#issuecomment-2892551496