{"record":{"id":"d1948f82ee4e736f","repo":"Comfy-Org/ComfyUI","slug":"a-cutoff-above-0-5-does-not-make-sense-d1948f","errorCode":null,"errorMessage":"A cutoff above 0.5 does not make sense.","messagePattern":"A cutoff above 0\\.5 does not make sense\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/mmaudio/vae/alias_free_torch.py","lineNumber":72,"sourceCode":"\n    return filter\n\n\nclass LowPassFilter1d(nn.Module):\n    def __init__(self,\n                 cutoff=0.5,\n                 half_width=0.6,\n                 stride: int = 1,\n                 padding: bool = True,\n                 padding_mode: str = 'replicate',\n                 kernel_size: int = 12):\n        # kernel_size should be even number for stylegan3 setup,\n        # in this implementation, odd number is also possible.\n        super().__init__()\n        if cutoff < -0.:\n            raise ValueError(\"Minimum cutoff must be larger than zero.\")\n        if cutoff > 0.5:\n            raise ValueError(\"A cutoff above 0.5 does not make sense.\")\n        self.kernel_size = kernel_size\n        self.even = (kernel_size % 2 == 0)\n        self.pad_left = kernel_size // 2 - int(self.even)\n        self.pad_right = kernel_size // 2\n        self.stride = stride\n        self.padding = padding\n        self.padding_mode = padding_mode\n        filter = kaiser_sinc_filter1d(cutoff, half_width, kernel_size)\n        self.register_buffer(\"filter\", filter)\n\n    #input [B, C, T]\n    def forward(self, x):\n        _, C, _ = x.shape\n\n        if self.padding:\n            x = F.pad(x, (self.pad_left, self.pad_right),\n                      mode=self.padding_mode)\n        out = F.conv1d(x, comfy.model_management.cast_to(self.filter.expand(C, -1, -1), dtype=x.dtype, device=x.device),","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/mmaudio/vae/alias_free_torch.py#L54-L90","documentation":"MMAudio VAE LowPassFilter1d raises when cutoff > 0.5: the sinc kernel's cutoff is normalized so 0.5 is Nyquist-relative maximum representable; anything higher is invalid. Fires at construction, before the VAE is used.","triggerScenarios":"Passing cutoff > 0.5 directly or via VAE config to the alias-free filter stack of the MMAudio VAE.","commonSituations":"Using Hz-valued cutoffs in a config meant to be normalized; tuning anti-aliasing strength by raising cutoff past the valid range.","solutions":["Normalize: cutoff = desired_hz / sample_rate, clamped to <= 0.5","Use the default 0.5","Validate the config values before constructing the VAE"],"exampleFix":"# before\nLowPassFilter1d(cutoff=0.7)\n# after\nLowPassFilter1d(cutoff=0.5)","handlingStrategy":"validation","validationCode":"cutoff = min(cutoff_hz / sample_rate, 0.5)\nassert cutoff <= 0.5","typeGuard":"def normalized_cutoff(hz: float, sr: float) -> float:\n    return min(hz / sr, 0.5)","tryCatchPattern":null,"preventionTips":["Normalize Hz values at the config boundary","Remember 0.5 is the maximum valid cutoff"],"tags":["mmaudio","vae","audio","config","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}