fix: external text input

This commit is contained in:
BennyKok
2024-01-16 15:36:05 +08:00
parent fa2638f66d
commit 8628480362
3 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -29,9 +29,9 @@ class ComfyUIDeployExternalNumber:
CATEGORY = "number"
def run(self, input_id, default_value=None):
if not input_id or len(input_id.strip()) == 0:
if not input_id or not input_id.strip().isdigit():
return [default_value]
return [input_id]
return [int(input_id)]
NODE_CLASS_MAPPINGS = {"ComfyUIDeployExternalNumber": ComfyUIDeployExternalNumber}
+2 -2
View File
@@ -29,9 +29,9 @@ class ComfyUIDeployExternalNumberInt:
CATEGORY = "number"
def run(self, input_id, default_value=None):
if not input_id or len(input_id.strip()) == 0:
if not input_id or not input_id.strip().isdigit():
return [default_value]
return [input_id]
return [int(input_id)]
NODE_CLASS_MAPPINGS = {"ComfyUIDeployExternalNumberInt": ComfyUIDeployExternalNumberInt}