fix(plugin): make sure number input nodes takes down to 0.01 steps and its casted to float

This commit is contained in:
bennykok 2024-02-28 11:59:16 -08:00
parent 19511e55ba
commit 9e79c434a9

View File

@ -29,9 +29,12 @@ class ComfyUIDeployExternalNumber:
CATEGORY = "number"
def run(self, input_id, default_value=None):
if not input_id or not input_id.strip().isdigit():
try:
float_value = float(input_id)
print("my number", float_value)
return [float_value]
except ValueError:
return [default_value]
return [int(input_id)]
NODE_CLASS_MAPPINGS = {"ComfyUIDeployExternalNumber": ComfyUIDeployExternalNumber}