{"record":{"id":"5df818aec007a5d4","repo":"Comfy-Org/ComfyUI","slug":"unknown-activation-type-activation-type","errorCode":null,"errorMessage":"Unknown activation type: {activation_type}","messagePattern":"Unknown activation type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/ace/vae/autoencoder_dc.py","lineNumber":49,"sourceCode":"    elif norm_type == \"layer_norm\":\n        return ops.LayerNorm(num_features)\n    elif norm_type == \"rms_norm\":\n        return RMSNorm(num_features, eps=eps, elementwise_affine=True, bias=True)\n    else:\n        raise ValueError(f\"Unknown normalization type: {norm_type}\")\n\n\ndef get_activation(activation_type):\n    if activation_type == \"relu\":\n        return nn.ReLU()\n    elif activation_type == \"relu6\":\n        return nn.ReLU6()\n    elif activation_type == \"silu\":\n        return nn.SiLU()\n    elif activation_type == \"leaky_relu\":\n        return nn.LeakyReLU(0.2)\n    else:\n        raise ValueError(f\"Unknown activation type: {activation_type}\")\n\n\nclass ResBlock(nn.Module):\n    def __init__(\n        self,\n        in_channels: int,\n        out_channels: int,\n        norm_type: str = \"batch_norm\",\n        act_fn: str = \"relu6\",\n    ) -> None:\n        super().__init__()\n\n        self.norm_type = norm_type\n        self.nonlinearity = get_activation(act_fn) if act_fn is not None else nn.Identity()\n        self.conv1 = ops.Conv2d(in_channels, in_channels, 3, 1, 1)\n        self.conv2 = ops.Conv2d(in_channels, out_channels, 3, 1, 1, bias=False)\n        self.norm = get_normalization(norm_type, out_channels)\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/ace/vae/autoencoder_dc.py#L31-L67","documentation":"Factory guard in comfy/ldm/ace/vae/autoencoder_dc.py: get_activation() supports exactly relu, relu6, silu, and leaky_relu. Any other act_fn string from the model config raises ValueError at build time, before any weights load.","triggerScenarios":"Loading an AutoencoderDC whose config specifies an unsupported activation, e.g. 'gelu', 'Swish', 'silu ' (trailing space), or 'mish'. The act_fn is defined per-block in the checkpoint's architecture config (ResBlock default is relu6).","commonSituations":"Hand-edited or upstream-drifted ACE VAE configs; configs exported from a different codebase using different activation naming; typo in a custom fine-tune config.","solutions":["Inspect the checkpoint config's act_fn values and correct them to one of relu|relu6|silu|leaky_relu","Check for casing/whitespace issues in the config string and normalize it","If the model truly requires another activation, extend get_activation in this fork rather than skipping the check"],"exampleFix":"# before (checkpoint config)\n\"act_fn\": \"swish\"\n\n# after\n\"act_fn\": \"silu\"","handlingStrategy":"validation","validationCode":"SUPPORTED_ACTS = {\"relu\", \"relu6\", \"silu\", \"leaky_relu\"}\nif cfg.get('act_fn') not in SUPPORTED_ACTS:\n    raise SystemExit(f\"unsupported act_fn {cfg.get('act_fn')}; supported: {SUPPORTED_ACTS}\")","typeGuard":"def is_supported_activation(name: str) -> bool:\n    return name in {\"relu\", \"relu6\", \"silu\", \"leaky_relu\"}","tryCatchPattern":null,"preventionTips":["Whitelist activation names at config load time","Prefer re-using the upstream config untouched over editing activation strings","Add config linting in custom loaders before model construction"],"tags":["config","vae","activation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}