Comfy-Org/ComfyUI · critical · ValueError
Missing ConvRot W4A4 weight scale for layer {layer_name}
Error message
Missing ConvRot W4A4 weight scale for layer {layer_name} What it means
Raised in comfy/ops.py when a layer's `comfy_quant` metadata specifies quant_format 'convrot_w4a4' but the state dict has no `weight_scale` for that layer. The ConvRot W4A4 format (4-bit weights, 4-bit activations with rotation) needs the weight scale plus a convrot_groupsize to be usable; the loader refuses to continue without it.
Source
Thrown at comfy/ops.py:1192
raise ValueError(f"Missing NVFP4 scales for layer {layer_name}")
scales = {"scale": ts, "block_scale": bs}
elif module.quant_format == "int8_tensorwise":
scale = pop_scale("weight_scale")
if scale is None:
raise ValueError(f"Missing INT8 weight scale for layer {layer_name}")
scales = {"scale": scale}
params_conf = layer_conf.get("params", {})
if not isinstance(params_conf, dict):
params_conf = {}
if layer_conf.get("convrot", params_conf.get("convrot", False)):
scales["convrot"] = True
scales["convrot_groupsize"] = int(
layer_conf.get("convrot_groupsize", params_conf.get("convrot_groupsize", 256))
)
elif module.quant_format == "convrot_w4a4":
scale = pop_scale("weight_scale")
if scale is None:
raise ValueError(f"Missing ConvRot W4A4 weight scale for layer {layer_name}")
params_conf = layer_conf.get("params", {})
if not isinstance(params_conf, dict):
params_conf = {}
scales = {
"scale": scale,
"convrot_groupsize": int(
layer_conf.get("convrot_groupsize", params_conf.get("convrot_groupsize", 256))
),
"quant_group_size": 64,
"linear_dtype": layer_conf.get("linear_dtype", params_conf.get("linear_dtype", "int4")),
}
elif module.quant_format == "asym_w4a8_int8":
# int4 weight (packed int8 [N,K/2]) + fp8 per-group scale (weight_s_rel),
# fp32 per-channel scale (weight_s_channel) + optional Lloyd-Max codebook.
scale = pop_scale("weight_s_rel")
if scale is None:
raise ValueError(f"Missing W4A8 group scale (weight_s_rel) for layer {layer_name}")
if scale.dtype == torch.uint8:View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Check the checkpoint for `<prefix>.weight_scale` next to the failing layer named in the message.
- Re-quantize using the ComfyUI convrot_w4a4 quantization path so scales and groupsize config are emitted together.
- Verify no key-remapping/merging step stripped scale tensors before load.
- Fall back to a supported format (int8_tensorwise, fp8) if the ConvRot scales cannot be regenerated.
Defensive patterns
Strategy: validation
Validate before calling
prefix = failing_layer_prefix # from the error message
assert (prefix + 'weight_scale') in sd, f'{prefix}weight_scale missing for convrot_w4a4 layer' Try / catch
try:
model_patcher = load_diffusion_model(path)
except ValueError as e:
if 'ConvRot W4A4' in str(e):
raise SystemExit('convrot_w4a4 checkpoint is missing scale tensors; re-quantize')
raise Prevention
- Keep the quantizer and loader on the same ComfyUI version for experimental formats like convrot_w4a4.
- Validate that every comfy_quant-bearing layer also has its scale keys before shipping a checkpoint.
When it happens
Trigger: Loading a convrot_w4a4-quantized checkpoint whose `weight_scale` keys are absent under the layer prefix; conversion scripts that emit the comfy_quant blob but skip scale tensors; prefix mismatches after key remapping.
Common situations: Models quantized with experimental ConvRot W4A4 tooling that is out of sync with the loader's expected key layout; partial or hand-merged checkpoints; renames during model surgery that break prefix alignment between comfy_quant and weight_scale.
Related errors
- Missing NVFP4 scales for layer {layer_name}
- Missing INT8 weight scale for layer {layer_name}
- Missing W4A8 group scale (weight_s_rel) for layer {layer_nam
- Unsupported quantization format: {module.quant_format}
- Unsupported dtype
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/918f762a11ef3cc8.
Report an issue: GitHub.