{"record":{"id":"65653e834008f3c5","repo":"Comfy-Org/ComfyUI","slug":"invalid-normalization-type-normtype","errorCode":null,"errorMessage":"Invalid normalization type: {normtype}","messagePattern":"Invalid normalization type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/lightricks/vae/causal_audio_autoencoder.py","lineNumber":98,"sourceCode":"    NONE = \"none\"\n\n\nclass CausalityAxis(StringConvertibleEnum):\n    \"\"\"Enum for specifying the causality axis in causal convolutions.\"\"\"\n\n    NONE = None\n    WIDTH = \"width\"\n    HEIGHT = \"height\"\n    WIDTH_COMPATIBILITY = \"width-compatibility\"\n\n\ndef Normalize(in_channels, *, num_groups=32, normtype=\"group\"):\n    if normtype == \"group\":\n        return torch.nn.GroupNorm(num_groups=num_groups, num_channels=in_channels, eps=1e-6, affine=True)\n    elif normtype == \"pixel\":\n        return PixelNorm(dim=1, eps=1e-6)\n    else:\n        raise ValueError(f\"Invalid normalization type: {normtype}\")\n\n\nclass CausalConv2d(nn.Module):\n    \"\"\"\n    A causal 2D convolution.\n\n    This layer ensures that the output at time `t` only depends on inputs\n    at time `t` and earlier. It achieves this by applying asymmetric padding\n    to the time dimension (width) before the convolution.\n    \"\"\"\n\n    def __init__(\n        self,\n        in_channels,\n        out_channels,\n        kernel_size,\n        stride=1,\n        dilation=1,","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/lightricks/vae/causal_audio_autoencoder.py#L80-L116","documentation":"Raised by the Normalize factory in the causal audio autoencoder when normtype is neither 'group' nor 'pixel'. The factory only constructs GroupNorm (for 'group') or PixelNorm (for 'pixel'); any other string falls through to this ValueError.","triggerScenarios":"Calling Normalize(in_channels, normtype=\"layer\"), \"batch\", \"instance\", or a typo like \"gruop\"; also triggered indirectly by constructing ResnetBlock(norm_type=...) or Encoder/Decoder with an unrecognized norm_type string.","commonSituations":"Porting configs that use layer/batch norm variants from other VAE implementations; typos in checkpoint config JSON (norm_type field); assuming a broader norm registry exists.","solutions":["Use 'group' (default) or 'pixel' as the normtype value","Check the norm_type value in the model config dict being passed to Encoder/Decoder","If a new norm type is genuinely needed, extend the Normalize factory with an explicit branch"],"exampleFix":"# before\nNormalize(in_channels, normtype=\"batch\")\n\n# after\nNormalize(in_channels, normtype=\"group\")","handlingStrategy":"validation","validationCode":"if norm_type not in (\"group\", \"pixel\"):\n    raise ValueError(f\"norm_type must be 'group' or 'pixel', got {norm_type!r}\")","typeGuard":"def is_valid_norm_type(t) -> bool:\n    return t in (\"group\", \"pixel\")","tryCatchPattern":null,"preventionTips":["Whitelist norm types before building audio VAE blocks","Cross-check checkpoint config fields against the supported set when loading new checkpoints"],"tags":["normalization","validation","audio-vae","config"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}