Comfy-Org/ComfyUI · error · ValueError

unknown block: {block_name}

Error message

unknown block: {block_name}

What it means

Raised by the causal video autoencoder Encoder when a block name in the down_blocks config is not one of the recognized names (res_block, downsample, compress_time, compress_space, compress_time_res, etc. depending on the builder). The config-driven block registry is closed; unknown names cannot be instantiated.

Source

Thrown at comfy/ldm/lightricks/vae/causal_video_autoencoder.py:198

                output_channel = block_params.get("multiplier", 2) * output_channel
                block = SpaceToDepthDownsample(
                    dims=dims,
                    in_channels=input_channel,
                    out_channels=output_channel,
                    stride=(1, 2, 2),
                    spatial_padding_mode=spatial_padding_mode,
                )
            elif block_name == "compress_time_res":
                output_channel = block_params.get("multiplier", 2) * output_channel
                block = SpaceToDepthDownsample(
                    dims=dims,
                    in_channels=input_channel,
                    out_channels=output_channel,
                    stride=(2, 1, 1),
                    spatial_padding_mode=spatial_padding_mode,
                )
            else:
                raise ValueError(f"unknown block: {block_name}")

            self.down_blocks.append(block)

        # out
        if norm_layer == "group_norm":
            self.conv_norm_out = nn.GroupNorm(
                num_channels=output_channel, num_groups=norm_num_groups, eps=1e-6
            )
        elif norm_layer == "pixel_norm":
            self.conv_norm_out = PixelNorm()
        elif norm_layer == "layer_norm":
            self.conv_norm_out = LayerNorm(output_channel, eps=1e-6)

        self.conv_act = nn.SiLU()

        conv_out_channels = out_channels
        if latent_log_var == "per_channel":
            conv_out_channels *= 2

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Compare the block name against the elif chain in the Encoder builder and fix typos (e.g. 'res_block', 'downsample', 'compress_time')
  2. Update ComfyUI to a version that supports the new block type
  3. Remove or replace the unsupported block entry in the config

Example fix

# before
down_blocks = [{"block": [{"name": "resblock"}]}]

# after
down_blocks = [{"block": [{"name": "res_block"}]}]
Defensive patterns

Strategy: validation

Validate before calling

KNOWN_DOWN = {"res_block", "downsample", "compress_time", "compress_space", "compress_time_res"}
for lvl in config["down_blocks"]:
    for blk in lvl["block"]:
        if blk["name"] not in KNOWN_DOWN:
            raise ValueError(f"unsupported down block {blk['name']!r}; supported: {sorted(KNOWN_DOWN)}")

Prevention

When it happens

Trigger: Constructing Encoder with a down_blocks list containing an unrecognized dict entry, e.g. {"name": "attn"} or {"name": "downsample2d"}, or a typo like "resblock".

Common situations: Loading a new LTX-family checkpoint whose config JSON introduces a block type this ComfyUI version does not know (version skew); hand-editing video VAE configs; typos in the name field.

Related errors


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