Comfy-Org/ComfyUI · error · NotImplementedError

Attention type {attn_type.value} is not supported yet.

Error message

Attention type {attn_type.value} is not supported yet.

What it means

Raised by make_attention when attn_type is AttentionType.LINEAR: the enum value is defined but the linear-attention implementation was never ported into this ComfyUI copy of the lightricks audio autoencoder. It is a NotImplementedError, not a config typo — the code path simply does not exist.

Source

Thrown at comfy/ldm/lightricks/vae/causal_audio_autoencoder.py:413

        return x + h_


def make_attn(in_channels, attn_type="vanilla", norm_type="group"):
    # Convert string to enum if needed
    attn_type = AttentionType.str_to_enum(attn_type)

    if attn_type != AttentionType.NONE:
        logging.info(f"making attention of type '{attn_type.value}' with {in_channels} in_channels")
    else:
        logging.info(f"making identity attention with {in_channels} in_channels")

    match attn_type:
        case AttentionType.VANILLA:
            return AttnBlock(in_channels, norm_type=norm_type)
        case AttentionType.NONE:
            return nn.Identity(in_channels)
        case AttentionType.LINEAR:
            raise NotImplementedError(f"Attention type {attn_type.value} is not supported yet.")
        case _:
            raise ValueError(f"Unknown attention type: {attn_type}")


class Encoder(nn.Module):
    def __init__(
        self,
        *,
        ch,
        out_ch,
        ch_mult=(1, 2, 4, 8),
        num_res_blocks,
        attn_resolutions,
        dropout=0.0,
        resamp_with_conv=True,
        in_channels,
        resolution,
        z_channels,

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Use AttentionType.VANILLA for standard attention blocks
  2. Use AttentionType.NONE for identity attention if attention is not needed at that resolution
  3. Remove 'linear' from the attention_type config entries before constructing the Encoder

Example fix

# before
attn = make_attention(ch, attn_type=AttentionType.LINEAR)

# after
attn = make_attention(ch, attn_type=AttentionType.VANILLA)
Defensive patterns

Strategy: validation

Validate before calling

if attn_type is AttentionType.LINEAR:
    raise ValueError("linear attention is not implemented; use vanilla or none")

Prevention

When it happens

Trigger: Calling make_attention(in_channels, attn_type=AttentionType.LINEAR) or building an Encoder whose config sets attention_type='linear' at any attention resolution.

Common situations: Loading a checkpoint trained with linear attention from the upstream lightricks repo; configs copied from LTX video/audio model configs that use linear attention to save compute.

Related errors


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