Comfy-Org/ComfyUI · error · NotImplementedError

Norm layer {norm_layer} is not implemented

Error message

Norm layer {norm_layer} is not implemented

What it means

In the Wan Animate face adapter, the qk-norm layer factory maps only "layer" (LayerNorm) and "rms" (RMSNorm); any other norm_layer string raises NotImplementedError. The adapter was built for exactly these two configs, so an unknown value signals a checkpoint config the code was never designed to load.

Source

Thrown at comfy/ldm/wan/model_animate.py:92

        return x_local


def get_norm_layer(norm_layer, operations=None):
    """
    Get the normalization layer.

    Args:
        norm_layer (str): The type of normalization layer.

    Returns:
        norm_layer (nn.Module): The normalization layer.
    """
    if norm_layer == "layer":
        return operations.LayerNorm
    elif norm_layer == "rms":
        return operations.RMSNorm
    else:
        raise NotImplementedError(f"Norm layer {norm_layer} is not implemented")


class FaceAdapter(nn.Module):
    def __init__(
        self,
        hidden_dim: int,
        heads_num: int,
        qk_norm: bool = True,
        qk_norm_type: str = "rms",
        num_adapter_layers: int = 1,
        dtype=None, device=None, operations=None
    ):

        factory_kwargs = {"dtype": dtype, "device": device}
        super().__init__()
        self.hidden_size = hidden_dim
        self.heads_num = heads_num
        self.fuser_blocks = nn.ModuleList(

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Use qk_norm_type="rms" (the default and what released checkpoints ship) or "layer".
  2. If the checkpoint truly uses a different norm, that model variant is unsupported — use the matching ComfyUI version or a converted checkpoint.
  3. Disable qk_norm only if the checkpoint actually has no qk-norm weights.

Example fix

# before
FaceAdapter(hidden_dim, heads_num, qk_norm_type="ln")
# after
FaceAdapter(hidden_dim, heads_num, qk_norm_type="rms")
Defensive patterns

Strategy: validation

Validate before calling

if qk_norm and qk_norm_type not in ("layer", "rms"):
    raise ValueError(f"unsupported qk_norm_type {qk_norm_type!r}; use 'layer' or 'rms'")
adapter = FaceAdapter(..., qk_norm_type=qk_norm_type)

Type guard

def is_supported_norm_type(t: str) -> bool:
    return t in ("layer", "rms")

Prevention

When it happens

Trigger: Constructing FaceAdapter with qk_norm_type set to something like "ln", "l2", "ada-ln", or "none" while qk_norm=True.

Common situations: Loading a community fine-tune whose config renamed the norm type; hand-porting a config from another Wan variant that uses a different norm name.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/2f8352bb0515bc9e. Report an issue: GitHub.