Comfy-Org/ComfyUI · error · ValueError
Unknown fuse_method '{fuse_method}'.
Error message
Unknown fuse_method '{fuse_method}'. What it means
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.
Source
Thrown at comfy/context_windows.py:988
PYRAMID = "pyramid"
RELATIVE = "relative"
OVERLAP_LINEAR = "overlap-linear"
LIST = [PYRAMID, FLAT, OVERLAP_LINEAR]
LIST_STATIC = [PYRAMID, RELATIVE, FLAT, OVERLAP_LINEAR]
FUSE_MAPPING = {
ContextFuseMethods.FLAT: create_weights_flat,
ContextFuseMethods.PYRAMID: create_weights_pyramid,
ContextFuseMethods.RELATIVE: create_weights_pyramid,
ContextFuseMethods.OVERLAP_LINEAR: create_weights_overlap_linear,
}
def get_matching_fuse_method(fuse_method: str) -> ContextFuseMethod:
func = FUSE_MAPPING.get(fuse_method, None)
if func is None:
raise ValueError(f"Unknown fuse_method '{fuse_method}'.")
return ContextFuseMethod(fuse_method, func)
# Returns fraction that has denominator that is a power of 2
def ordered_halving(val):
# get binary value, padded with 0s for 64 bits
bin_str = f"{val:064b}"
# flip binary value, padding included
bin_flip = bin_str[::-1]
# convert binary to int
as_int = int(bin_flip, 2)
# divide by 1 << 64, equivalent to 2**64, or 18446744073709551616,
# or b10000000000000000000000000000000000000000000000000000000000000000 (1 with 64 zero's)
return as_int / (1 << 64)
def get_missing_indexes(windows: list[list[int]], num_frames: int) -> list[int]:
all_indexes = list(range(num_frames))
for w in windows:View on GitHub (pinned to 1c6d8d45b3)
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).
Example fix
# before
get_matching_fuse_method("overlap-linear")
# after
from comfy.context_windows import ContextFuseMethods, get_matching_fuse_method
get_matching_fuse_method(ContextFuseMethods.OVERLAP_LINEAR) Defensive patterns
Strategy: validation
Validate before calling
from comfy.context_windows import FUSE_MAPPING
if fuse_method not in FUSE_MAPPING:
raise SystemExit(f"unknown fuse method; valid: {list(FUSE_MAPPING)}")
fuse = get_matching_fuse_method(fuse_method) Type guard
from comfy.context_windows import FUSE_MAPPING
def is_valid_fuse_method(name: str) -> bool:
return name in FUSE_MAPPING Try / catch
try:
fuse = get_matching_fuse_method(name)
except ValueError:
fuse = get_matching_fuse_method("flat") # safe default Prevention
- Use the ContextFuseMethods enum.
- Normalize external names (strip/lower, map gaussian→pyramid) before lookup.
When it happens
Trigger: 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.
Common situations: Free-text input fields instead of combos; enum drift between ComfyUI versions; copy-pasting fuse method names from other tools (AnimateDiff 'gaussian' etc.).
Related errors
- Unknown context_schedule '{context_schedule}'.
- {cls.__name__} does not have a NONE member to map None to
- Invalid {cls.__name__} string: '{value}'. Valid values are:
- Cannot convert type {type(value).__name__} to {cls.__name__}
- Invalid causality_axis: {causality_axis}
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/da912772ca8ae570.
Report an issue: GitHub.