{"record":{"id":"da912772ca8ae570","repo":"Comfy-Org/ComfyUI","slug":"unknown-fuse-method-fuse-method","errorCode":null,"errorMessage":"Unknown fuse_method '{fuse_method}'.","messagePattern":"Unknown fuse_method '(.+?)'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/context_windows.py","lineNumber":988,"sourceCode":"    PYRAMID = \"pyramid\"\n    RELATIVE = \"relative\"\n    OVERLAP_LINEAR = \"overlap-linear\"\n\n    LIST = [PYRAMID, FLAT, OVERLAP_LINEAR]\n    LIST_STATIC = [PYRAMID, RELATIVE, FLAT, OVERLAP_LINEAR]\n\n\nFUSE_MAPPING = {\n    ContextFuseMethods.FLAT: create_weights_flat,\n    ContextFuseMethods.PYRAMID: create_weights_pyramid,\n    ContextFuseMethods.RELATIVE: create_weights_pyramid,\n    ContextFuseMethods.OVERLAP_LINEAR: create_weights_overlap_linear,\n}\n\ndef get_matching_fuse_method(fuse_method: str) -> ContextFuseMethod:\n    func = FUSE_MAPPING.get(fuse_method, None)\n    if func is None:\n        raise ValueError(f\"Unknown fuse_method '{fuse_method}'.\")\n    return ContextFuseMethod(fuse_method, func)\n\n# Returns fraction that has denominator that is a power of 2\ndef ordered_halving(val):\n    # get binary value, padded with 0s for 64 bits\n    bin_str = f\"{val:064b}\"\n    # flip binary value, padding included\n    bin_flip = bin_str[::-1]\n    # convert binary to int\n    as_int = int(bin_flip, 2)\n    # divide by 1 << 64, equivalent to 2**64, or 18446744073709551616,\n    # or b10000000000000000000000000000000000000000000000000000000000000000 (1 with 64 zero's)\n    return as_int / (1 << 64)\n\n\ndef get_missing_indexes(windows: list[list[int]], num_frames: int) -> list[int]:\n    all_indexes = list(range(num_frames))\n    for w in windows:","sourceCodeStart":970,"sourceCodeEnd":1006,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/context_windows.py#L970-L1006","documentation":"get_matching_fuse_method resolves a fusion-strategy name to a weight function via FUSE_MAPPING (FLAT, PYRAMID, RELATIVE, OVERL_LINEAR). Unknown names raise ValueError. Note RELATIVE maps to the same pyramid weight function as PYRAMID — only these four identifiers are legal.","triggerScenarios":"Calling get_matching_fuse_method with a misspelled or newer fuse name ('pyrmaid', 'gaussian', 'overlap-linear' with a dash instead of underscore); custom nodes exposing their own fuse names not present in FUSE_MAPPING.","commonSituations":"Free-text input fields instead of combos; enum drift between ComfyUI versions; copy-pasting fuse method names from other tools (AnimateDiff 'gaussian' etc.).","solutions":["Pass one of the exact identifiers: see ContextFuseMethods in comfy/context_windows.py (e.g. 'flat', 'pyramid', 'relative', 'overlap_linear' — use the enum to avoid spelling issues).","Restrict node inputs to a combo built from list(FUSE_MAPPING).","Map external names to supported ones before calling (gaussian→pyramid if acceptable)."],"exampleFix":"# before\nget_matching_fuse_method(\"overlap-linear\")\n\n# after\nfrom comfy.context_windows import ContextFuseMethods, get_matching_fuse_method\nget_matching_fuse_method(ContextFuseMethods.OVERLAP_LINEAR)","handlingStrategy":"validation","validationCode":"from comfy.context_windows import FUSE_MAPPING\nif fuse_method not in FUSE_MAPPING:\n    raise SystemExit(f\"unknown fuse method; valid: {list(FUSE_MAPPING)}\")\nfuse = get_matching_fuse_method(fuse_method)","typeGuard":"from comfy.context_windows import FUSE_MAPPING\ndef is_valid_fuse_method(name: str) -> bool:\n    return name in FUSE_MAPPING","tryCatchPattern":"try:\n    fuse = get_matching_fuse_method(name)\nexcept ValueError:\n    fuse = get_matching_fuse_method(\"flat\")  # safe default","preventionTips":["Use the ContextFuseMethods enum.","Normalize external names (strip/lower, map gaussian→pyramid) before lookup."],"tags":["context-windows","validation","enum"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}