{"record":{"id":"6bbb831a612e7acd","repo":"Comfy-Org/ComfyUI","slug":"seedvr2postprocessing-unknown-color-correction-me","errorCode":null,"errorMessage":"SeedVR2PostProcessing: unknown color_correction_method {color_correction_method!r}","messagePattern":"SeedVR2PostProcessing: unknown color_correction_method (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_seedvr.py","lineNumber":213,"sourceCode":"        target_w = min(decoded_5d.shape[3], reference_w)\n        decoded_5d = decoded_5d[:, :, :target_h, :target_w, :]\n        if color_correction_method in (\"lab\", \"wavelet\", \"adain\"):\n            reference_5d = reference_full[:b, :t, :, :, :]\n            reference_5d = cls._resize_reference(reference_5d, target_h, target_w)\n            output_device = decoded_5d.device\n            decoded_raw = cls._to_seedvr2_raw(decoded_5d)\n            reference_raw = cls._to_seedvr2_raw(reference_5d)\n            decoded_flat = decoded_raw.permute(0, 1, 4, 2, 3).reshape(b * t, decoded_raw.shape[4], target_h, target_w)\n            reference_flat = reference_raw.permute(0, 1, 4, 2, 3).reshape(b * t, reference_raw.shape[4], target_h, target_w)\n            output = cls._color_transfer_chunked(\n                decoded_flat, reference_flat, output_device, color_correction_method,\n            )\n            output = output.reshape(b, t, output.shape[1], output.shape[2], output.shape[3]).permute(0, 1, 3, 4, 2)\n            output = output.add(1.0).div(2.0).clamp(0.0, 1.0)\n        elif color_correction_method == \"none\":\n            output = decoded_5d\n        else:\n            raise ValueError(f\"SeedVR2PostProcessing: unknown color_correction_method {color_correction_method!r}\")\n\n        if alpha_input is not None:\n            alpha_5d, _ = cls._as_bthwc(alpha_input)\n            alpha_5d = alpha_5d[:output.shape[0], :output.shape[1], :output.shape[2], :output.shape[3], :]\n            output = torch.cat([output, alpha_5d.to(dtype=output.dtype, device=output.device)], dim=-1)\n        h2 = output.shape[-3] - (output.shape[-3] % 2)\n        w2 = output.shape[-2] - (output.shape[-2] % 2)\n        output = output[:, :, :h2, :w2, :]\n        if decoded_was_4d:\n            output = output.reshape(-1, output.shape[-3], output.shape[-2], output.shape[-1])\n        return io.NodeOutput(output)\n\n    @staticmethod\n    def _as_bthwc(images):\n        if images.ndim == 4:\n            return images.unsqueeze(0), True\n        if images.ndim == 5:\n            return images, False","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_seedvr.py#L195-L231","documentation":"SeedVR2PostProcessing dispatches on the color_correction_method string: 'lab', 'wavelet', 'adain', and 'none' are implemented. Any other value falls into the final else and raises this error naming the unknown method. It is a strict enum check — there is no silent default.","triggerScenarios":"Supplying color_correction_method='LAB' (wrong case), 'none '/typo, or a new method name not in {lab, wavelet, adain, none} to SeedVR2PostProcessing, e.g. via a serialized workflow JSON or an API call that bypasses the combo widget.","commonSituations":"Hand-edited workflow JSON with a stale or misspelled enum; a frontend/custom node passing its own method names; version skew where a method was renamed or removed between ComfyUI versions.","solutions":["Set color_correction_method to one of: 'lab', 'wavelet', 'adain', 'none'.","Check the workflow JSON for stale values (case-sensitive, no surrounding whitespace) and re-save from the UI.","If a custom frontend supplies the value, validate it against the allowed set before queueing the prompt."],"exampleFix":"# before\n{\"color_correction_method\": \"LAB\"}\n\n# after\n{\"color_correction_method\": \"lab\"}","handlingStrategy":"validation","validationCode":"ALLOWED = {'lab', 'wavelet', 'adain', 'none'}\nif color_correction_method not in ALLOWED:\n    raise ValueError(f'invalid color_correction_method {color_correction_method!r}; use one of {sorted(ALLOWED)}')","typeGuard":"def is_valid_color_method(v) -> bool:\n    return isinstance(v, str) and v in {'lab', 'wavelet', 'adain', 'none'}","tryCatchPattern":null,"preventionTips":["Build prompts with values copied from the node's combo list, not typed from memory.","Re-save hand-edited workflows in the UI to normalize enums.","Validate enum inputs at the API boundary before queueing."],"tags":["seedvr","enum","validation","workflow-json"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}