{"record":{"id":"27dd6ded62f0e1d6","repo":"Comfy-Org/ComfyUI","slug":"unsupported-input-type-type-value-name","errorCode":null,"errorMessage":"Unsupported input type: {type(value).__name__}","messagePattern":"Unsupported input type: (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_number_convert.py","lineNumber":72,"sourceCode":"            text = value.strip()\n            if not text:\n                raise ValueError(\"Cannot convert empty string to number.\")\n            try:\n                float_val = float(text)\n            except ValueError:\n                raise ValueError(\n                    f\"Cannot convert string to number: {value!r}\"\n                ) from None\n            if not math.isfinite(float_val):\n                raise ValueError(\n                    f\"Cannot convert non-finite value to number: {float_val}\"\n                )\n            try:\n                int_val = int(text)\n            except ValueError:\n                int_val = int(float_val)\n        else:\n            raise TypeError(\n                f\"Unsupported input type: {type(value).__name__}\"\n            )\n\n        if not math.isfinite(float_val):\n            raise ValueError(\n                f\"Cannot convert non-finite value to number: {float_val}\"\n            )\n\n        return io.NodeOutput(float_val, int_val)\n\n\nclass NumberConvertExtension(ComfyExtension):\n    @override\n    async def get_node_list(self) -> list[type[io.ComfyNode]]:\n        return [NumberConvertNode]\n\n\nasync def comfy_entrypoint() -> NumberConvertExtension:","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_number_convert.py#L54-L90","documentation":"Raised as TypeError when the value passed to the number-conversion node is not bool, int, float, or str (e.g. a list, dict, tensor, or None). The node deliberately enumerates supported types instead of duck-typing, so any other type fails fast with the actual type name.","triggerScenarios":"Connecting a LIST, DICT, IMAGE tensor, or None output to the converter's value input, or sending such a JSON value via the API prompt.","commonSituations":"Workflow wiring mistakes where a container/tensor output is connected to a number slot; API payloads passing null or nested objects for what should be a scalar.","solutions":["Connect a scalar source: a number primitive, boolean, or a string containing a number.","For tensors, first extract a scalar with an appropriate node (e.g. indexing/reduction) before conversion.","For lists, pick a single element upstream instead of passing the whole list."],"exampleFix":"// before\nNumberConvert(value=[1, 2, 3])\n// after\nNumberConvert(value=1)","handlingStrategy":"type-guard","validationCode":"if not isinstance(value, (bool, int, float, str)):\n    raise TypeError(f\"NumberConvert expects bool/int/float/str, got {type(value).__name__}\")","typeGuard":"def is_convertible_number_input(v) -> bool:\n    return isinstance(v, (bool, int, float, str))","tryCatchPattern":null,"preventionTips":["Check output socket types in the graph before connecting to the converter.","Extract scalars from tensors/lists with appropriate nodes before number conversion."],"tags":["type-conversion","typeerror","number","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}