{"record":{"id":"59ca2908918bba39","repo":"Comfy-Org/ComfyUI","slug":"unknown-block-type-block-type","errorCode":null,"errorMessage":"Unknown block type: {block_type}","messagePattern":"Unknown block type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"comfy/ldm/cosmos/blocks.py","lineNumber":647,"sourceCode":"        if block_type in [\"cross_attn\", \"ca\"]:\n            self.block = VideoAttn(\n                x_dim,\n                context_dim,\n                num_heads,\n                bias=bias,\n                qkv_norm_mode=qkv_norm_mode,\n                x_format=self.x_format,\n                weight_args=weight_args,\n                operations=operations,\n            )\n        elif block_type in [\"full_attn\", \"fa\"]:\n            self.block = VideoAttn(\n                x_dim, None, num_heads, bias=bias, qkv_norm_mode=qkv_norm_mode, x_format=self.x_format, weight_args=weight_args, operations=operations\n            )\n        elif block_type in [\"mlp\", \"ff\"]:\n            self.block = GPT2FeedForward(x_dim, int(x_dim * mlp_ratio), dropout=mlp_dropout, bias=bias, weight_args=weight_args, operations=operations)\n        else:\n            raise ValueError(f\"Unknown block type: {block_type}\")\n\n        self.block_type = block_type\n        self.use_adaln_lora = use_adaln_lora\n\n        self.norm_state = nn.LayerNorm(x_dim, elementwise_affine=False, eps=1e-6)\n        self.n_adaln_chunks = 3\n        if use_adaln_lora:\n            self.adaLN_modulation = nn.Sequential(\n                nn.SiLU(),\n                operations.Linear(x_dim, adaln_lora_dim, bias=False, **weight_args),\n                operations.Linear(adaln_lora_dim, self.n_adaln_chunks * x_dim, bias=False, **weight_args),\n            )\n        else:\n            self.adaLN_modulation = nn.Sequential(nn.SiLU(), operations.Linear(x_dim, self.n_adaln_chunks * x_dim, bias=False, **weight_args))\n\n    def forward(\n        self,\n        x: torch.Tensor,","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/cosmos/blocks.py#L629-L665","documentation":"DITBuildingBlock in the Cosmos prediction network wraps one sub-block chosen by a block_type string: 'self_attn'/'sa' (CrossAttention as self-attention), 'full_attn'/'fa' (VideoAttn), 'cross_attn'/'ca', or 'mlp'/'ff' (GPT2FeedForward). Any other string falls to the else-branch and raises at construction. The block strings come from the per-layer block configuration lists of the Cosmos model config.","triggerScenarios":"Building a Cosmos DIT with a block list containing an unknown tag, e.g. 'window_attn', 'conv', or a typo like 'selfatten'. Each GeneralDITTransformerBlock layer specifies a list like ['self_attn', 'cross_attn', 'mlp']; every entry is dispatched through this constructor.","commonSituations":"Porting configs from upstream Cosmos versions with additional block types (e.g. window attention variants); hand-editing block lists to prune layers; loading a Cosmos variant (Predict2 vs Predict1) not supported by the current ComfyUI code.","solutions":["Use only the supported tags: self_attn/sa, cross_attn/ca, full_attn/fa, mlp/ff","Check which Cosmos variant the checkpoint is and whether your ComfyUI version supports its block vocabulary","Update ComfyUI to a release matching the checkpoint's architecture"],"exampleFix":"# before\nblock_types = [\"self_attn\", \"cross_attn\", \"conv\"]  # 'conv' unknown\n\n# after\nblock_types = [\"self_attn\", \"cross_attn\", \"mlp\"]","handlingStrategy":"validation","validationCode":"VALID_BLOCKS = {\"self_attn\", \"sa\", \"cross_attn\", \"ca\", \"full_attn\", \"fa\", \"mlp\", \"ff\"}\nassert all(b in VALID_BLOCKS for layer in block_config for b in layer), \"unknown Cosmos block tag\"","typeGuard":"def is_valid_cosmos_block(tag: str) -> bool:\n    return tag in {\"self_attn\", \"sa\", \"cross_attn\", \"ca\", \"full_attn\", \"fa\", \"mlp\", \"ff\"}","tryCatchPattern":null,"preventionTips":["Use block configs copied verbatim from supported Cosmos checkpoints","Validate the full block vocabulary before building the DIT"],"tags":["cosmos","dit","block-config","model-init"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}