ControlNet: Error(s) in loading state_dict … size mismatch (ControlNet does not match the base model)
The ControlNet model was built for a different model family than your checkpoint, so the weights do not match.
The message
RuntimeError: Error(s) in loading state_dict for ControlNet: size mismatch for input_blocks.1.1.proj_in.weight: copying a param with shape torch.Size([320, 320]) from checkpoint, the shape in current model is torch.Size([320, 320, 1, 1]). | RuntimeError: mat1 and mat2 shapes cannot be multiplied (154x1024 and 768x320)
Affects: AUTOMATIC1111 Stable Diffusion WebUI, ComfyUI
Why is this happening?
A ControlNet is always trained for a specific model family, such as SD 1.5, SD 2.x, SDXL, or Flux. The layers in these families have different sizes. If you combine an SD-1.5 ControlNet with an SD-2.1 or SDXL checkpoint, loading fails with “size mismatch” or the computation fails with “mat1 and mat2 shapes cannot be multiplied”. This is not a program error, but a wrong combination.
How to fix it
- Check which base model your checkpoint was made for (download page, e.g. “SD 1.5”, “SDXL”, “Flux”).
- Check the same thing for the ControlNet. It is often in the file name, e.g.
control_v11p_sd15_…for SD 1.5 or…sdxl…for SDXL. - Replace either the ControlNet or the checkpoint until both belong to the same family: SD-1.5 checkpoint with SD-1.5 ControlNet, SDXL with SDXL. For SD 2.1, you need your own SD-2.1 ControlNets.
- AUTOMATIC1111 with the sd-webui-controlnet extension: Put ControlNet models in
stable-diffusion-webui\models\ControlNetorextensions\sd-webui-controlnet\models. SDXL ControlNets require sd-webui-controlnet version 1.1.400 or later and WebUI version 1.6.0 or later. - ComfyUI: ControlNet models belong in
ComfyUI\models\controlnet. In the “Load ControlNet Model” node, choose a file that matches the checkpoint family. - The safest approach is to start with a template for your exact model family and load all files from the same source.
Better not: A different YAML configuration or a reinstall will not help here: only a matching ControlNet model fixes the error.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- SafetensorError: incomplete metadata / MetadataIncompleteBuffer
- 'git' is not recognized
- 'python' is not recognized or opens the Microsoft Store
- A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x – a package does not match the installed NumPy version
- AMD Radeon is not being used, PyTorch is running on the CPU
Sources
- https://github.com/lllyasviel/ControlNet/issues/377
- https://github.com/Mikubill/sd-webui-controlnet/issues/1727
- https://docs.comfy.org/troubleshooting/model-issues
- https://github.com/Mikubill/sd-webui-controlnet/discussions/2039
Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.