{"record":{"id":"6afa110a7b45c192","repo":"Comfy-Org/ComfyUI","slug":"node-cls-name-is-not-expandable-but-expand","errorCode":null,"errorMessage":"Node {cls.__name__} is not expandable, but expand included in NodeOutput; developer should set enable_expand=True on node's Schema to allow this.","messagePattern":"Node (.+?) is not expandable, but expand included in NodeOutput; developer should set enable_expand=True on node's Schema to allow this\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"comfy_api/latest/_io.py","lineNumber":2004,"sourceCode":"\n    @final\n    @classmethod\n    def EXECUTE_NORMALIZED(cls, *args, **kwargs) -> NodeOutput:\n        to_return = cls.execute(*args, **kwargs)\n        if to_return is None:\n            to_return = NodeOutput()\n        elif isinstance(to_return, NodeOutput):\n            pass\n        elif isinstance(to_return, tuple):\n            to_return = NodeOutput(*to_return)\n        elif isinstance(to_return, dict):\n            to_return = NodeOutput.from_dict(to_return)\n        elif isinstance(to_return, ExecutionBlocker):\n            to_return = NodeOutput(block_execution=to_return.message)\n        else:\n            raise Exception(f\"Invalid return type from node: {type(to_return)}\")\n        if to_return.expand is not None and not cls.SCHEMA.enable_expand:\n            raise Exception(f\"Node {cls.__name__} is not expandable, but expand included in NodeOutput; developer should set enable_expand=True on node's Schema to allow this.\")\n        return to_return\n\n    @final\n    @classmethod\n    async def EXECUTE_NORMALIZED_ASYNC(cls, *args, **kwargs) -> NodeOutput:\n        to_return = await cls.execute(*args, **kwargs)\n        if to_return is None:\n            to_return = NodeOutput()\n        elif isinstance(to_return, NodeOutput):\n            pass\n        elif isinstance(to_return, tuple):\n            to_return = NodeOutput(*to_return)\n        elif isinstance(to_return, dict):\n            to_return = NodeOutput.from_dict(to_return)\n        elif isinstance(to_return, ExecutionBlocker):\n            to_return = NodeOutput(block_execution=to_return.message)\n        else:\n            raise Exception(f\"Invalid return type from node: {type(to_return)}\")","sourceCodeStart":1986,"sourceCodeEnd":2022,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api/latest/_io.py#L1986-L2022","documentation":"A node's execute() returned a NodeOutput carrying an `expand` payload, but the node's SCHEMA does not set enable_expand=True. Expansion is an opt-in capability; the executor refuses to silently drop the expand data or run it for a node that never declared support.","triggerScenarios":"Node code builds NodeOutput(expand=...) while the node's Schema lacks enable_expand=True — typically after adding expand logic without updating the schema, or copying expand-producing code into another node.","commonSituations":"Copying an expandable node's execute body into a non-expandable node; schema refactors dropping the flag; enable_expand set on the wrong class in an inheritance chain.","solutions":["Set enable_expand=True on the node's Schema if expansion is intended.","Otherwise remove the expand argument from the returned NodeOutput."],"exampleFix":"# before\nclass Schema(IO.Schema):\n    enable_expand = False\n# execute returns NodeOutput(expand=...) -> Exception\n\n# after\nclass Schema(IO.Schema):\n    enable_expand = True","handlingStrategy":"validation","validationCode":"assert cls.SCHEMA.enable_expand or output.expand is None, \"set enable_expand=True to return expand\"","typeGuard":"def expand_allowed(cls) -> bool:\n    return bool(getattr(cls.SCHEMA, \"enable_expand\", False))","tryCatchPattern":null,"preventionTips":["Declare enable_expand=True on the Schema before shipping expand outputs.","When copying execute bodies between nodes, diff their Schemas too."],"tags":["comfyui","node-contract","expand","schema","developer-error"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}