Comfy-Org/ComfyUI · critical · ValueError

Unsupported nerf_final_head_type {params.nerf_final_head_typ

Error message

Unsupported nerf_final_head_type {params.nerf_final_head_type}

What it means

ChromaRadiance builds its final NeRF head based on params.nerf_final_head_type: a linear-head variant ('linear'/default branch) or a convolutional head ('conv', NerfFinalLayerConv). Any other string reaches the else-branch and raises ValueError with the offending value. This is a construction-time config validation: the radiance final-layer architecture is a closed set.

Source

Thrown at comfy/ldm/chroma_radiance/model.py:158

        if params.nerf_final_head_type == "linear":
            self.nerf_final_layer = NerfFinalLayer(
                params.nerf_hidden_size,
                out_channels=params.in_channels,
                dtype=dtype,
                device=device,
                operations=operations,
            )
        elif params.nerf_final_head_type == "conv":
            self.nerf_final_layer_conv = NerfFinalLayerConv(
                params.nerf_hidden_size,
                out_channels=params.in_channels,
                dtype=dtype,
                device=device,
                operations=operations,
            )
        else:
            errstr = f"Unsupported nerf_final_head_type {params.nerf_final_head_type}"
            raise ValueError(errstr)

        self.skip_mmdit = []
        self.skip_dit = []
        self.lite = False

        if params.use_x0:
            self.register_buffer("__x0__", torch.tensor([]))

        if params.use_sequential_txt_ids:
            self.register_buffer("__sequential__", torch.tensor([]))

    @property
    def _nerf_final_layer(self) -> nn.Module:
        if self.params.nerf_final_head_type == "linear":
            return self.nerf_final_layer
        if self.params.nerf_final_head_type == "conv":
            return self.nerf_final_layer_conv
        # Impossible to get here as we raise an error on unexpected types on initialization.

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Set nerf_final_head_type to 'linear' or 'conv' exactly (lowercase)
  2. If the checkpoint requires another head type, update ComfyUI to a version that supports it
  3. Check the checkpoint's stored params for the head type instead of guessing; do not override it in options

Example fix

# before
ChromaRadiance(nerf_final_head_type="Conv", ...)  # capital C -> raises

# after
ChromaRadiance(nerf_final_head_type="conv", ...)
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_HEADS = {"linear", "conv"}
if config.get("nerf_final_head_type") not in SUPPORTED_HEADS:
    config["nerf_final_head_type"] = "linear"

Type guard

def is_supported_nerf_head(t: str) -> bool:
    return t in {"linear", "conv"}

Prevention

When it happens

Trigger: Constructing ChromaRadiance with nerf_final_head_type set to something other than the two supported values, e.g. 'conv3d', 'upsample', or an empty string, usually via kwargs from a custom config or a transformer_options override path that constructs new params.

Common situations: Community radiance checkpoints with experimental head types unsupported by this ComfyUI version; editing the radiance config to try different decoders; typo in a custom loader ('Conv' vs 'conv').

Related errors


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