Unable to load this model
I'm using ComfyUI's GGUF Loader to load nodes, but an error message pops up! How can I fix this?
RuntimeError: Error(s) in loading state_dict for WanModel:
size mismatch for blocks.0.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.1.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.2.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.3.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.4.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.5.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.6.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.7.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.8.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.9.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.10.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.11.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.12.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.13.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.14.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.15.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.16.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.17.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.18.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.19.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.20.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.21.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.22.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.23.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.24.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.25.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.26.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.27.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.28.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.29.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.30.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.31.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.32.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.33.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.34.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.35.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.36.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.37.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.38.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for blocks.39.modulation: copying a param with shape torch.Size([6, 5120]) from checkpoint, the shape in current model is torch.Size([1, 6, 5120]).
size mismatch for head.modulation: copying a param with shape torch.Size([2, 5120]) from checkpoint, the shape in current model is torch.Size([1, 2, 5120]).
class LoaderGGUF:
............
sd = load_gguf_sd(model_path)
# ===== Fix ===== [6, 5120] β [1, 6, 5120]
for k in list(sd.keys()):
v = sd[k]
if "modulation" in k and isinstance(v, torch.Tensor) and v.ndim == 2:
logging.info(f"[GGUF FIX] Expanding {k} from {v.shape} -> {(1,)+v.shape}")
sd[k] = v.unsqueeze(0)
# =============================================
model = comfy.sd.load_diffusion_model_state_dict(sd, model_options=
{'custom_operations': ops})
................

