{"record":{"id":"236aa1e19a776efd","repo":"Comfy-Org/ComfyUI","slug":"unknown-resblock-type-self-resblock","errorCode":null,"errorMessage":"Unknown resblock type: {self.resblock}","messagePattern":"Unknown resblock type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/lightricks/vocoders/vocoder.py","lineNumber":467,"sourceCode":"        # preprocessing.stft.hop_length (see CausalAudioAutoencoder).\n        self.output_sample_rate = config.get(\"output_sample_rate\")\n        self.resblock = config.get(\"resblock\", \"1\")\n        self.use_tanh_at_final = config.get(\"use_tanh_at_final\", True)\n        self.apply_final_activation = config.get(\"apply_final_activation\", True)\n        self.num_kernels = len(resblock_kernel_sizes)\n        self.num_upsamples = len(upsample_rates)\n\n        in_channels = 128 if stereo else 64\n        self.conv_pre = ops.Conv1d(in_channels, upsample_initial_channel, 7, 1, padding=3)\n\n        if self.resblock == \"1\":\n            resblock_cls = ResBlock1\n        elif self.resblock == \"2\":\n            resblock_cls = ResBlock2\n        elif self.resblock == \"AMP1\":\n            resblock_cls = AMPBlock1\n        else:\n            raise ValueError(f\"Unknown resblock type: {self.resblock}\")\n\n        self.ups = nn.ModuleList()\n        for i, (u, k) in enumerate(zip(upsample_rates, upsample_kernel_sizes)):\n            self.ups.append(\n                ops.ConvTranspose1d(\n                    upsample_initial_channel // (2**i),\n                    upsample_initial_channel // (2 ** (i + 1)),\n                    k,\n                    u,\n                    padding=(k - u) // 2,\n                )\n            )\n\n        self.resblocks = nn.ModuleList()\n        for i in range(len(self.ups)):\n            ch = upsample_initial_channel // (2 ** (i + 1))\n            for k, d in zip(resblock_kernel_sizes, resblock_dilation_sizes):\n                if self.resblock == \"AMP1\":","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/lightricks/vocoders/vocoder.py#L449-L485","documentation":"Raised by the lightricks vocoder constructor when its resblock discriminator/generator setting is not one of the supported strings: '1' (ResBlock1), '2' (ResBlock2), or 'AMP1' (AMPBlock1). It is a config-driven dispatch: the resblock type string comes from the vocoder config and must match exactly. Any other value aborts model construction.","triggerScenarios":"Building the vocoder with resblock set to a value like 'AMP2', '3', 'resblock1' (wrong case), or None. Note the check is string-based and case-sensitive.","commonSituations":"Loading a vocoder checkpoint whose config was saved by a newer/older upstream version supporting more resblock types; manually editing config YAML/JSON; upstream BigVGAN configs that use 'AMPBlock' naming conventions different from this repo's strings.","solutions":["Set resblock to '1', '2', or 'AMP1' in the vocoder config","Check for case/spacing: the value must be exactly one of the three strings","If the checkpoint came from another codebase, port its resblock name to the closest supported type here"],"exampleFix":"# before\nvocoder = Vocoder(resblock='AMP2')\n# after\nvocoder = Vocoder(resblock='AMP1')","handlingStrategy":"validation","validationCode":"VALID_RESBLOCKS = {'1', '2', 'AMP1'}\nif cfg['resblock'] not in VALID_RESBLOCKS:\n    raise ValueError(f\"resblock must be one of {sorted(VALID_RESBLOCKS)}, got {cfg['resblock']!r}\")","typeGuard":"def is_valid_resblock(name: str) -> bool:\n    return name in {'1', '2', 'AMP1'}","tryCatchPattern":null,"preventionTips":["Whitelist-check config strings before model construction","When porting checkpoints, map upstream resblock names explicitly"],"tags":["vocoder","audio","config","model-loading"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}