{"record":{"id":"0f71c439627a1959","repo":"Comfy-Org/ComfyUI","slug":"unknown-normalization-type-norm-type","errorCode":null,"errorMessage":"Unknown normalization type: {norm_type}","messagePattern":"Unknown normalization type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/ace/vae/autoencoder_dc.py","lineNumber":36,"sourceCode":"    def forward(self, x):\n        x = super().forward(x)\n        if self.elementwise_affine:\n            if self.bias is not None:\n                x = x + comfy.model_management.cast_to(self.bias, dtype=x.dtype, device=x.device)\n        return x\n\n\ndef get_normalization(norm_type, num_features, num_groups=32, eps=1e-5):\n    if norm_type == \"batch_norm\":\n        return nn.BatchNorm2d(num_features)\n    elif norm_type == \"group_norm\":\n        return ops.GroupNorm(num_groups, num_features)\n    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,","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/ace/vae/autoencoder_dc.py#L18-L54","documentation":"Factory guard in the ACE depth-conv VAE (comfy/ldm/ace/vae/autoencoder_dc.py): get_normalization() only constructs batch_norm, group_norm, layer_norm, and rms_norm. Any other norm_type string in the model config raises ValueError because no module can be built for the checkpoint's architecture description.","triggerScenarios":"Building AutoencoderDC (or a block calling get_normalization) from a config whose norm_type is e.g. 'group_norm_32', 'BN', 'sync_batchnorm', or a typo like 'gruop_norm'. The value comes straight from the checkpoint's JSON config, not user node inputs.","commonSituations":"Loading a fine-tuned or community-modified ACE/DC-VAE checkpoint whose config was edited or came from a newer upstream that added a normalization type this code does not support; porting a diffusers AutoencoderDC config with renamed norm types.","solutions":["Open the checkpoint's config and check the norm_type fields; map them to one of batch_norm|group_norm|layer_norm|rms_norm","If the config uses a synonym (e.g. 'batchnorm'), correct it to the exact supported spelling","If the checkpoint genuinely needs an unsupported norm, update this fork to handle it in get_normalization before loading"],"exampleFix":"# before (checkpoint config)\n\"norm_type\": \"batchnorm\"\n\n# after\n\"norm_type\": \"batch_norm\"","handlingStrategy":"validation","validationCode":"SUPPORTED_NORMS = {\"batch_norm\", \"group_norm\", \"layer_norm\", \"rms_norm\"}\nassert all(nt in SUPPORTED_NORMS for nt in cfg['norm_type'] if isinstance(nt, str)) or cfg['norm_type'] in SUPPORTED_NORMS","typeGuard":"def is_supported_norm(norm_type: str) -> bool:\n    return norm_type in {\"batch_norm\", \"group_norm\", \"layer_norm\", \"rms_norm\"}","tryCatchPattern":null,"preventionTips":["Validate checkpoint config strings against the loader's supported set before building","Keep a canonical copy of the original released config next to custom checkpoints","Normalize/alias common synonyms (batchnorm->batch_norm) in your own export tooling"],"tags":["config","vae","normalization"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}