{"record":{"id":"89399e516484d2c3","repo":"sgl-project/sglang","slug":"unsupported-down-block-type-down-block-type","errorCode":null,"errorMessage":"Unsupported down_block_type: {down_block_type}","messagePattern":"Unsupported down_block_type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/vaes/hunyuanvae.py","lineNumber":638,"sourceCode":"        norm_num_groups: int = 32,\n        act_fn: str = \"silu\",\n        double_z: bool = True,\n        mid_block_add_attention=True,\n        temporal_compression_ratio: int = 4,\n        spatial_compression_ratio: int = 8,\n    ) -> None:\n        super().__init__()\n\n        self.conv_in = HunyuanVideoCausalConv3d(\n            in_channels, block_out_channels[0], kernel_size=3, stride=1\n        )\n        self.mid_block: HunyuanVideoMidBlock3D | None = None\n        self.down_blocks = nn.ModuleList([])\n\n        output_channel = block_out_channels[0]\n        for i, down_block_type in enumerate(down_block_types):\n            if down_block_type != \"HunyuanVideoDownBlock3D\":\n                raise ValueError(f\"Unsupported down_block_type: {down_block_type}\")\n\n            input_channel = output_channel\n            output_channel = block_out_channels[i]\n            is_final_block = i == len(block_out_channels) - 1\n            num_spatial_downsample_layers = int(np.log2(spatial_compression_ratio))\n            num_time_downsample_layers = int(np.log2(temporal_compression_ratio))\n\n            if temporal_compression_ratio == 4:\n                add_spatial_downsample = bool(i < num_spatial_downsample_layers)\n                add_time_downsample = bool(\n                    i >= (len(block_out_channels) - 1 - num_time_downsample_layers)\n                    and not is_final_block\n                )\n            elif temporal_compression_ratio == 8:\n                add_spatial_downsample = bool(i < num_spatial_downsample_layers)\n                add_time_downsample = bool(i < num_time_downsample_layers)\n            else:\n                raise ValueError(","sourceCodeStart":620,"sourceCodeEnd":656,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/vaes/hunyuanvae.py#L620-L656","documentation":"HunyuanVideoVAE's encoder construction iterates over down_block_types and only accepts the literal string 'HunyuanVideoDownBlock3D'. Any other block type name in the model config raises this ValueError, because no other downsampling block implementation exists in this VAE.","triggerScenarios":"Instantiating the VAE (e.g. via from_pretrained / config load) whose config JSON has down_block_types containing anything other than \"HunyuanVideoDownBlock3D\", such as values ported from diffusers-style configs ('DownBlock3D', 'CrossAttnDownBlock3D').","commonSituations":"Loading a community-finetuned or converted VAE checkpoint whose config.json was edited or generated by a different toolchain; typos in a hand-written config; diffusers-to-sglang config conversion that left incompatible block names.","solutions":["Open the checkpoint's config.json and set every entry of down_block_types to \"HunyuanVideoDownBlock3D\"","Use an official HunyuanVideo/Hunyuan3D VAE checkpoint whose config matches this implementation","If you genuinely need another block architecture, implement the block class and extend the branch in __init__"],"exampleFix":"// before\n\"down_block_types\": [\"DownBlock3D\", \"DownBlock3D\"]\n\n// after\n\"down_block_types\": [\"HunyuanVideoDownBlock3D\", \"HunyuanVideoDownBlock3D\"]","handlingStrategy":"validation","validationCode":"cfg = json.load(open(vae_config_path))\nallowed = {\"HunyuanVideoDownBlock3D\"}\nassert set(cfg[\"down_block_types\"]) <= allowed, f'bad down_block_types: {cfg[\"down_block_types\"]}'","typeGuard":"def is_supported_down_blocks(types: list) -> bool:\n    return all(t == 'HunyuanVideoDownBlock3D' for t in types)","tryCatchPattern":null,"preventionTips":["Use official HunyuanVideo/Hunyuan3D VAE checkpoints unmodified","Validate checkpoint config.json block names before loading","Re-check configs after any diffusers->sglang conversion"],"tags":["python","value-error","model-config","hunyuan-vae","unsupported-block"],"backgroundTag":"unsupported-config-option","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}