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

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}

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}

View File

@ -2,5 +2,6 @@ export const customInputNodes: Record<string, string> = {
ComfyUIDeployExternalText: "string",
ComfyUIDeployExternalImage: "string - (public image url)",
ComfyUIDeployExternalImageAlpha: "string - (public image url)",
ComfyUIDeployExternalNumber: "number"
ComfyUIDeployExternalNumber: "float",
ComfyUIDeployExternalNumberInt: "integer",
};